[evolution-mapi] Just rename them
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi] Just rename them
- Date: Wed, 26 Oct 2011 17:29:37 +0000 (UTC)
commit 020aee35334430360e5def00ad3a2f5ba2a0d7c0
Author: Milan Crha <mcrha redhat com>
Date: Wed Oct 26 19:26:27 2011 +0200
Just rename them
A little cleanup for shorter "namespace" of library functions
and making CamelMapiSummary a CamelMapiFolderSummary.
src/account-setup-eplugin/Makefile.am | 12 +-
...ccount-listener.c => e-mapi-account-listener.c} | 180 ++++----
.../e-mapi-account-listener.h | 57 ++
...ccount-settings.c => e-mapi-account-settings.c} | 22 +-
...mapi-account-setup.c => e-mapi-account-setup.c} | 138 +++---
...mapi-account-setup.h => e-mapi-account-setup.h} | 12 +-
.../exchange-mapi-account-listener.h | 57 --
.../org-gnome-exchange-mapi.eplug.xml | 28 +-
src/addressbook/e-book-backend-mapi-contacts.c | 88 ++--
src/addressbook/e-book-backend-mapi-gal.c | 22 +-
src/addressbook/e-book-backend-mapi.c | 62 ++--
src/addressbook/e-book-backend-mapi.h | 12 +-
src/calendar/e-cal-backend-mapi.c | 276 +++++-----
src/camel/Makefile.am | 4 +-
...-mapi-summary.c => camel-mapi-folder-summary.c} | 48 +-
...-mapi-summary.h => camel-mapi-folder-summary.h} | 44 +-
src/camel/camel-mapi-folder.c | 100 ++--
src/camel/camel-mapi-folder.h | 2 +-
src/camel/camel-mapi-notifications.c | 16 +-
src/camel/camel-mapi-store.c | 84 ++--
src/camel/camel-mapi-store.h | 6 +-
src/camel/camel-mapi-transport.c | 12 +-
src/camel/camel-mapi-transport.h | 2 +-
src/libexchangemapi/Makefile.am | 76 ++--
...-cal-recur-utils.c => e-mapi-cal-recur-utils.c} | 6 +-
...-cal-recur-utils.h => e-mapi-cal-recur-utils.h} | 10 +-
...e-mapi-cal-tz-utils.c => e-mapi-cal-tz-utils.c} | 192 +-------
...api-cal-recur-utils.h => e-mapi-cal-tz-utils.h} | 18 +-
...xchange-mapi-cal-utils.c => e-mapi-cal-utils.c} | 234 +++++-----
...xchange-mapi-cal-utils.h => e-mapi-cal-utils.h} | 38 +-
...hange-mapi-connection.c => e-mapi-connection.c} | 544 ++++++++++----------
src/libexchangemapi/e-mapi-connection.h | 278 ++++++++++
.../{exchange-mapi-debug.c => e-mapi-debug.c} | 14 +-
.../{exchange-mapi-debug.h => e-mapi-debug.h} | 14 +-
.../{exchange-mapi-defs.h => e-mapi-defs.h} | 6 +-
src/libexchangemapi/e-mapi-fast-transfer.c | 18 +-
src/libexchangemapi/e-mapi-fast-transfer.h | 8 +-
.../{exchange-mapi-folder.c => e-mapi-folder.c} | 54 +-
.../{exchange-mapi-folder.h => e-mapi-folder.h} | 53 +-
...hange-mapi-mail-utils.c => e-mapi-mail-utils.c} | 90 ++--
...hange-mapi-mail-utils.h => e-mapi-mail-utils.h} | 14 +-
...-operation-queue.c => e-mapi-operation-queue.c} | 88 ++--
src/libexchangemapi/e-mapi-operation-queue.h | 72 +++
.../{exchange-mapi-utils.c => e-mapi-utils.c} | 164 +++---
src/libexchangemapi/e-mapi-utils.h | 79 +++
src/libexchangemapi/em-operation-queue.h | 72 ---
src/libexchangemapi/exchange-mapi-cal-tz-utils.h | 119 -----
src/libexchangemapi/exchange-mapi-connection.h | 278 ----------
src/libexchangemapi/exchange-mapi-utils.h | 79 ---
49 files changed, 1816 insertions(+), 2086 deletions(-)
---
diff --git a/src/account-setup-eplugin/Makefile.am b/src/account-setup-eplugin/Makefile.am
index f094e1e..76af68c 100644
--- a/src/account-setup-eplugin/Makefile.am
+++ b/src/account-setup-eplugin/Makefile.am
@@ -14,12 +14,12 @@ plugin_DATA = org-gnome-exchange-mapi.eplug
plugin_LTLIBRARIES = liborg-gnome-exchange-mapi.la
-liborg_gnome_exchange_mapi_la_SOURCES = \
- exchange-mapi-account-setup.c \
- exchange-mapi-account-setup.h \
- exchange-mapi-account-settings.c \
- exchange-mapi-account-listener.c \
- exchange-mapi-account-listener.h
+liborg_gnome_exchange_mapi_la_SOURCES = \
+ e-mapi-account-setup.c \
+ e-mapi-account-setup.h \
+ e-mapi-account-settings.c \
+ e-mapi-account-listener.c \
+ e-mapi-account-listener.h
liborg_gnome_exchange_mapi_la_LIBADD = \
$(top_builddir)/src/libexchangemapi/libexchangemapi-1.0.la \
diff --git a/src/account-setup-eplugin/exchange-mapi-account-listener.c b/src/account-setup-eplugin/e-mapi-account-listener.c
similarity index 87%
rename from src/account-setup-eplugin/exchange-mapi-account-listener.c
rename to src/account-setup-eplugin/e-mapi-account-listener.c
index b277bb2..c98c113 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-listener.c
+++ b/src/account-setup-eplugin/e-mapi-account-listener.c
@@ -25,8 +25,8 @@
#include <config.h>
#endif
-#include "exchange-mapi-account-listener.h"
-#include "exchange-mapi-account-setup.h"
+#include "e-mapi-account-listener.h"
+#include "e-mapi-account-setup.h"
#include <string.h>
#include <glib/gi18n-lib.h>
#include <camel/camel.h>
@@ -38,10 +38,10 @@
#include <libedataserver/e-source-list.h>
#include <shell/e-shell.h>
-#include <exchange-mapi-folder.h>
-#include <exchange-mapi-connection.h>
-#include <exchange-mapi-utils.h>
-#include <em-operation-queue.h>
+#include <e-mapi-folder.h>
+#include <e-mapi-connection.h>
+#include <e-mapi-utils.h>
+#include <e-mapi-operation-queue.h>
#define d(x)
@@ -56,34 +56,34 @@
} \
} G_STMT_END
-G_DEFINE_TYPE (ExchangeMAPIAccountListener, exchange_mapi_account_listener, G_TYPE_OBJECT)
+G_DEFINE_TYPE (EMapiAccountListener, e_mapi_account_listener, G_TYPE_OBJECT)
static gboolean create_profile_entry (CamelURL *url, EAccount *account, CamelMapiSettings *settings);
-struct _ExchangeMAPIAccountListenerPrivate {
+struct _EMapiAccountListenerPrivate {
GConfClient *gconf_client;
/* we get notification about mail account changes from this object */
EAccountList *account_list;
};
-typedef struct _ExchangeMAPIAccountInfo ExchangeMAPIAccountInfo;
+typedef struct _EMapiAccountInfo EMapiAccountInfo;
/* stores some info about all currently existing mapi accounts */
-struct _ExchangeMAPIAccountInfo {
+struct _EMapiAccountInfo {
gchar *uid;
gchar *name;
gchar *source_url;
gboolean enabled;
};
-static ExchangeMAPIAccountInfo *
-copy_mapi_account_info (const ExchangeMAPIAccountInfo *src)
+static EMapiAccountInfo *
+copy_mapi_account_info (const EMapiAccountInfo *src)
{
- ExchangeMAPIAccountInfo *res;
+ EMapiAccountInfo *res;
g_return_val_if_fail (src != NULL, NULL);
- res = g_new0 (ExchangeMAPIAccountInfo, 1);
+ res = g_new0 (EMapiAccountInfo, 1);
res->uid = g_strdup (src->uid);
res->name = g_strdup (src->name);
res->source_url = g_strdup (src->source_url);
@@ -93,7 +93,7 @@ copy_mapi_account_info (const ExchangeMAPIAccountInfo *src)
}
static void
-free_mapi_account_info (ExchangeMAPIAccountInfo *info)
+free_mapi_account_info (EMapiAccountInfo *info)
{
g_return_if_fail (info != NULL);
@@ -103,16 +103,16 @@ free_mapi_account_info (ExchangeMAPIAccountInfo *info)
g_free (info);
}
-/* list of ExchangeMAPIAccountInfo structures */
+/* list of EMapiAccountInfo structures */
static GList *mapi_accounts = NULL;
-static gpointer async_ops = NULL; /* EMOperationQueue * */
+static gpointer async_ops = NULL; /* EMapiOperationQueue * */
static GObjectClass *parent_class = NULL;
static void
dispose (GObject *object)
{
- ExchangeMAPIAccountListener *config_listener = EXCHANGE_MAPI_ACCOUNT_LISTENER (object);
+ EMapiAccountListener *config_listener = E_MAPI_ACCOUNT_LISTENER (object);
g_object_unref (config_listener->priv->gconf_client);
g_object_unref (config_listener->priv->account_list);
@@ -123,7 +123,7 @@ dispose (GObject *object)
static void
finalize (GObject *object)
{
- ExchangeMAPIAccountListener *config_listener = EXCHANGE_MAPI_ACCOUNT_LISTENER (object);
+ EMapiAccountListener *config_listener = E_MAPI_ACCOUNT_LISTENER (object);
GList *list;
if (config_listener->priv) {
@@ -131,7 +131,7 @@ finalize (GObject *object)
}
for (list = g_list_first (mapi_accounts); list; list = g_list_next (list)) {
- ExchangeMAPIAccountInfo *info = (ExchangeMAPIAccountInfo *)(list->data);
+ EMapiAccountInfo *info = (EMapiAccountInfo *)(list->data);
if (info) {
g_free (info->uid);
g_free (info->name);
@@ -149,7 +149,7 @@ finalize (GObject *object)
}
static void
-exchange_mapi_account_listener_class_init (ExchangeMAPIAccountListenerClass *class)
+e_mapi_account_listener_class_init (EMapiAccountListenerClass *class)
{
GObjectClass *object_class;
@@ -162,9 +162,9 @@ exchange_mapi_account_listener_class_init (ExchangeMAPIAccountListenerClass *cla
}
static void
-exchange_mapi_account_listener_init (ExchangeMAPIAccountListener *config_listener)
+e_mapi_account_listener_init (EMapiAccountListener *config_listener)
{
- config_listener->priv = g_new0 (ExchangeMAPIAccountListenerPrivate, 1);
+ config_listener->priv = g_new0 (EMapiAccountListenerPrivate, 1);
}
/*determines whehter the passed in account is exchange or not by looking at source url */
@@ -177,7 +177,7 @@ is_mapi_account (EAccount *account)
/* looks up for an existing exchange account info in the mapi_accounts list based on uid */
-static ExchangeMAPIAccountInfo*
+static EMapiAccountInfo*
lookup_account_info (const gchar *key)
{
GList *list;
@@ -185,7 +185,7 @@ lookup_account_info (const gchar *key)
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);
+ EMapiAccountInfo *info = (EMapiAccountInfo *)(list->data);
if (g_ascii_strcasecmp (info->uid, key) == 0)
return info;
}
@@ -226,7 +226,7 @@ find_source_by_fid (GSList *sources, const gchar *fid)
#define ADDRESSBOOK_SOURCES "/apps/evolution/addressbook/sources"
static void
-add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType folder_type, CamelURL *url, CamelSettings *settings, mapi_id_t trash_fid)
+add_cal_esource (EAccount *account, GSList *folders, EMapiFolderType folder_type, CamelURL *url, CamelSettings *settings, mapi_id_t trash_fid)
{
CamelMapiSettings *mapi_settings;
ESourceList *source_list = NULL;
@@ -259,7 +259,7 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
conf_key = JOURNAL_SOURCES;
source_selection_key = SELECTED_JOURNALS;
} else {
- g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
+ g_warning ("%s: %s: Unknown EMapiFolderType\n", G_STRLOC, G_STRFUNC);
return;
}
@@ -296,15 +296,15 @@ 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;
+ EMapiFolder *folder = temp_list->data;
ESource *source = NULL;
gchar *relative_uri = NULL, *fid = NULL;
gboolean is_new_source = FALSE;
- if (folder->container_class != folder_type || trash_fid == exchange_mapi_folder_get_parent_id (folder))
+ if (folder->container_class != folder_type || trash_fid == e_mapi_folder_get_parent_id (folder))
continue;
- fid = exchange_mapi_util_mapi_id_to_string (folder->folder_id);
+ fid = e_mapi_util_mapi_id_to_string (folder->folder_id);
relative_uri = g_strconcat (";", fid, NULL);
source = find_source_by_fid (old_sources, fid);
if (source) {
@@ -337,7 +337,7 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
e_source_set_property (source, "delete", NULL);
if (folder->parent_folder_id) {
- gchar *tmp = exchange_mapi_util_mapi_id_to_string (folder->parent_folder_id);
+ gchar *tmp = e_mapi_util_mapi_id_to_string (folder->parent_folder_id);
e_source_set_property (source, "parent-fid", tmp);
g_free (tmp);
} else {
@@ -392,7 +392,7 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
g_object_unref (client);
}
-void exchange_mapi_add_esource (CamelService *service, const gchar *folder_name, const gchar *fid, gint folder_type)
+void e_mapi_add_esource (CamelService *service, const gchar *folder_name, const gchar *fid, gint folder_type)
{
CamelNetworkSettings *network_settings;
CamelOfflineSettings *offline_settings;
@@ -422,7 +422,7 @@ void exchange_mapi_add_esource (CamelService *service, const gchar *folder_name,
else if (folder_type == MAPI_FOLDER_TYPE_CONTACT)
conf_key = ADDRESSBOOK_SOURCES;
else {
- g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
+ g_warning ("%s: %s: Unknown EMapiFolderType\n", G_STRLOC, G_STRFUNC);
return;
}
@@ -485,7 +485,7 @@ void exchange_mapi_add_esource (CamelService *service, const gchar *folder_name,
g_object_unref (client);
}
-void exchange_mapi_remove_esource (CamelService *service, const gchar * folder_name, const gchar *fid, gint folder_type)
+void e_mapi_remove_esource (CamelService *service, const gchar * folder_name, const gchar *fid, gint folder_type)
{
CamelNetworkSettings *network_settings;
CamelSettings *settings;
@@ -511,7 +511,7 @@ void exchange_mapi_remove_esource (CamelService *service, const gchar * folder_n
else if (folder_type == MAPI_FOLDER_TYPE_CONTACT)
conf_key = ADDRESSBOOK_SOURCES;
else {
- g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
+ g_warning ("%s: %s: Unknown EMapiFolderType\n", G_STRLOC, G_STRFUNC);
return;
}
@@ -544,7 +544,7 @@ void exchange_mapi_remove_esource (CamelService *service, const gchar * folder_n
}
static void
-remove_cal_esource (EAccount *existing_account_info, ExchangeMAPIFolderType folder_type, CamelURL *url)
+remove_cal_esource (EAccount *existing_account_info, EMapiFolderType folder_type, CamelURL *url)
{
ESourceList *list;
const gchar *conf_key = NULL, *source_selection_key = NULL;
@@ -564,7 +564,7 @@ remove_cal_esource (EAccount *existing_account_info, ExchangeMAPIFolderType fold
conf_key = JOURNAL_SOURCES;
source_selection_key = SELECTED_JOURNALS;
} else {
- g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
+ g_warning ("%s: %s: Unknown EMapiFolderType\n", G_STRLOC, G_STRFUNC);
return;
}
@@ -665,7 +665,7 @@ remove_calendar_sources (EAccount *account)
g_object_ref (account);
if (!g_main_context_get_thread_default () || g_main_context_is_owner (g_main_context_default ())) {
- em_async_queue_push (async_ops, account, NULL, NULL, remove_calendar_sources_async);
+ e_mapi_async_queue_push (async_ops, account, NULL, NULL, remove_calendar_sources_async);
} else {
remove_calendar_sources_async (account, FALSE, NULL);
}
@@ -729,14 +729,14 @@ add_addressbook_sources (EAccount *account, GSList *folders, mapi_id_t trash_fid
e_source_group_set_property (group, "kerberos", kerberos);
for (temp_list = folders; temp_list != NULL; temp_list = g_slist_next (temp_list)) {
- ExchangeMAPIFolder *folder = temp_list->data;
+ EMapiFolder *folder = temp_list->data;
gchar *fid, *relative_uri;
gboolean is_new_source = FALSE;
- if (folder->container_class != MAPI_FOLDER_TYPE_CONTACT || trash_fid == exchange_mapi_folder_get_parent_id (folder))
+ if (folder->container_class != MAPI_FOLDER_TYPE_CONTACT || trash_fid == e_mapi_folder_get_parent_id (folder))
continue;
- fid = exchange_mapi_util_mapi_id_to_string (folder->folder_id);
+ fid = e_mapi_util_mapi_id_to_string (folder->folder_id);
relative_uri = g_strconcat (";", folder->folder_name, NULL);
source = find_source_by_fid (old_sources, fid);
if (source) {
@@ -771,7 +771,7 @@ add_addressbook_sources (EAccount *account, GSList *folders, mapi_id_t trash_fid
e_source_set_property (source, "delete", NULL);
if (folder->parent_folder_id) {
- gchar *tmp = exchange_mapi_util_mapi_id_to_string (folder->parent_folder_id);
+ gchar *tmp = e_mapi_util_mapi_id_to_string (folder->parent_folder_id);
e_source_set_property (source, "parent-fid", tmp);
g_free (tmp);
} else {
@@ -866,7 +866,7 @@ add_addressbook_sources (EAccount *account, GSList *folders, mapi_id_t trash_fid
static void
remove_addressbook_sources_async (gpointer worker_data, gboolean cancelled, gpointer user_data)
{
- ExchangeMAPIAccountInfo *existing_account_info = worker_data;
+ EMapiAccountInfo *existing_account_info = worker_data;
ESourceList *list;
ESourceGroup *group;
GSList *groups;
@@ -904,12 +904,12 @@ remove_addressbook_sources_async (gpointer worker_data, gboolean cancelled, gpoi
}
static void
-remove_addressbook_sources (ExchangeMAPIAccountInfo *existing_account_info)
+remove_addressbook_sources (EMapiAccountInfo *existing_account_info)
{
g_return_if_fail (existing_account_info != NULL);
if (!g_main_context_get_thread_default () || g_main_context_is_owner (g_main_context_default ())) {
- em_async_queue_push (async_ops, copy_mapi_account_info (existing_account_info), NULL, NULL, remove_addressbook_sources_async);
+ e_mapi_async_queue_push (async_ops, copy_mapi_account_info (existing_account_info), NULL, NULL, remove_addressbook_sources_async);
} else {
remove_addressbook_sources_async (copy_mapi_account_info (existing_account_info), FALSE, NULL);
}
@@ -933,7 +933,7 @@ add_sources_async (gpointer worker_data, gboolean cancelled, gpointer user_data)
add_calendar_sources (data->account, data->folders, data->trash_fid);
g_object_unref (data->account);
- exchange_mapi_folder_free_list (data->folders);
+ e_mapi_folder_free_list (data->folders);
g_free (data);
}
@@ -947,11 +947,11 @@ add_sources (EAccount *account, GSList *folders, mapi_id_t trash_fid)
data = g_new0 (struct add_sources_data, 1);
data->account = g_object_ref (account);
- data->folders = exchange_mapi_folder_copy_list (folders);
+ data->folders = e_mapi_folder_copy_list (folders);
data->trash_fid = trash_fid;
if (!g_main_context_get_thread_default () || g_main_context_is_owner (g_main_context_default ())) {
- em_async_queue_push (async_ops, data, NULL, NULL, add_sources_async);
+ e_mapi_async_queue_push (async_ops, data, NULL, NULL, add_sources_async);
} else {
add_sources_async (data, FALSE, NULL);
}
@@ -960,7 +960,7 @@ add_sources (EAccount *account, GSList *folders, mapi_id_t trash_fid)
static void
update_sources_idle_cb (gpointer data, gboolean cancelled, gpointer user_data)
{
- ExchangeMapiConnection *conn = data;
+ EMapiConnection *conn = data;
EAccount *account;
GSList *folders_list;
@@ -976,7 +976,7 @@ update_sources_idle_cb (gpointer data, gboolean cancelled, gpointer user_data)
g_object_set_data (G_OBJECT (conn), "EAccount", NULL);
if (!cancelled) {
- folders_list = exchange_mapi_connection_peek_folders_list (conn);
+ folders_list = e_mapi_connection_peek_folders_list (conn);
if (account->enabled && lookup_account_info (account->uid)) {
mapi_id_t *trash_fid = user_data;
@@ -993,7 +993,7 @@ update_sources_idle_cb (gpointer data, gboolean cancelled, gpointer user_data)
static void
update_sources_cb (gpointer data, gboolean cancelled, gpointer user_data)
{
- ExchangeMapiConnection *conn = data;
+ EMapiConnection *conn = data;
mapi_id_t *trash_id = user_data;
if (cancelled)
@@ -1003,14 +1003,14 @@ update_sources_cb (gpointer data, gboolean cancelled, gpointer user_data)
/* this fetches folder_list to the connection cache,
thus next call will be quick as much as possible */
- exchange_mapi_connection_peek_folders_list (conn);
+ e_mapi_connection_peek_folders_list (conn);
if (trash_id)
- *trash_id = exchange_mapi_connection_get_default_folder_id (conn, olFolderDeletedItems, NULL);
+ *trash_id = e_mapi_connection_get_default_folder_id (conn, olFolderDeletedItems, NULL);
}
static void
-run_update_sources_thread (ExchangeMapiConnection *conn, EAccount *account)
+run_update_sources_thread (EMapiConnection *conn, EAccount *account)
{
g_return_if_fail (conn != NULL);
g_return_if_fail (account != NULL);
@@ -1018,7 +1018,7 @@ run_update_sources_thread (ExchangeMapiConnection *conn, EAccount *account)
g_object_set_data (G_OBJECT (conn), "EAccount", g_object_ref (account));
- em_async_queue_push (async_ops, conn, g_new0 (mapi_id_t, 1), update_sources_cb, update_sources_idle_cb);
+ e_mapi_async_queue_push (async_ops, conn, g_new0 (mapi_id_t, 1), update_sources_cb, update_sources_idle_cb);
}
struct create_sources_data
@@ -1037,9 +1037,9 @@ check_for_account_conn_cb (gpointer data)
g_return_val_if_fail (csd->account != NULL, FALSE);
if (csd->account->enabled && lookup_account_info (csd->account->uid)) {
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
- conn = exchange_mapi_connection_find (csd->profile_name);
+ conn = e_mapi_connection_find (csd->profile_name);
if (!conn) {
/* try later, it's still trying to connect */
return TRUE;
@@ -1060,7 +1060,7 @@ update_account_sources_async (gpointer worker_data, gboolean cancelled, gpointer
{
CamelURL *url;
CamelSettings *settings;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
EAccount *account = worker_data;
gboolean can_create_profile = GPOINTER_TO_INT (user_data) ? TRUE : FALSE;
const gchar *profile;
@@ -1073,7 +1073,7 @@ update_account_sources_async (gpointer worker_data, gboolean cancelled, gpointer
profile = camel_mapi_settings_get_profile (CAMEL_MAPI_SETTINGS (settings));
- conn = exchange_mapi_connection_find (profile);
+ conn = e_mapi_connection_find (profile);
if (!conn && can_create_profile) {
/* connect to the server when not connected yet */
if (!create_profile_entry (url, account, CAMEL_MAPI_SETTINGS (settings))) {
@@ -1083,7 +1083,7 @@ update_account_sources_async (gpointer worker_data, gboolean cancelled, gpointer
return;
}
- conn = exchange_mapi_connection_find (profile);
+ conn = e_mapi_connection_find (profile);
}
if (conn) {
@@ -1111,7 +1111,7 @@ update_account_sources (EAccount *account, gboolean can_create_profile)
if (!g_main_context_get_thread_default () || g_main_context_is_owner (g_main_context_default ())) {
/* called from main thread, but we want this to be called
in its own thread, thus create it */
- em_async_queue_push (async_ops, g_object_ref (account), GINT_TO_POINTER (can_create_profile ? 1 : 0), update_account_sources_async, NULL);
+ e_mapi_async_queue_push (async_ops, g_object_ref (account), GINT_TO_POINTER (can_create_profile ? 1 : 0), update_account_sources_async, NULL);
} else {
update_account_sources_async (g_object_ref (account), FALSE, GINT_TO_POINTER (can_create_profile ? 1 : 0));
}
@@ -1120,12 +1120,12 @@ update_account_sources (EAccount *account, gboolean can_create_profile)
static void
mapi_account_added (EAccountList *account_listener, EAccount *account)
{
- ExchangeMAPIAccountInfo *info = NULL;
+ EMapiAccountInfo *info = NULL;
if (!is_mapi_account (account))
return;
- info = g_new0 (ExchangeMAPIAccountInfo, 1);
+ info = g_new0 (EMapiAccountInfo, 1);
info->uid = g_strdup (account->uid);
info->name = g_strdup (account->name);
info->source_url = g_strdup (account->source->url);
@@ -1140,7 +1140,7 @@ mapi_account_added (EAccountList *account_listener, EAccount *account)
static void
mapi_account_removed (EAccountList *account_listener, EAccount *account)
{
- ExchangeMAPIAccountInfo *info = NULL;
+ EMapiAccountInfo *info = NULL;
CamelURL *url = NULL;
if (!is_mapi_account (account))
@@ -1168,7 +1168,7 @@ mapi_account_removed (EAccountList *account_listener, EAccount *account)
gchar *key = camel_url_to_string (url, CAMEL_URL_HIDE_PARAMS);
GError *error = NULL;
- exchange_mapi_delete_profile (profile, &error);
+ e_mapi_delete_profile (profile, &error);
e_passwords_forget_password (NULL, key);
g_free (key);
@@ -1188,14 +1188,14 @@ create_profile_entry (CamelURL *url, EAccount *account, CamelMapiSettings *setti
{
gboolean status = FALSE;
guint8 attempts = 0;
- ExchangeMapiProfileData empd = { 0 };
+ EMapiProfileData empd = { 0 };
if (!e_shell_get_online (e_shell_get_default ()))
return FALSE;
empd.server = url->host;
empd.username = url->user;
- exchange_mapi_util_profiledata_from_settings (&empd, settings);
+ e_mapi_util_profiledata_from_settings (&empd, settings);
while (!status && attempts <= 3) {
gchar *key = NULL;
@@ -1218,19 +1218,19 @@ create_profile_entry (CamelURL *url, EAccount *account, CamelMapiSettings *setti
if (empd.password || empd.krb_sso) {
GError *error = NULL;
- status = exchange_mapi_create_profile (&empd, NULL,
+ status = e_mapi_create_profile (&empd, NULL,
NULL, &error);
if (status) {
/* profile was created, try to connect to the server */
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
gchar *profname;
status = FALSE;
- profname = exchange_mapi_util_profile_name (&empd, FALSE);
+ profname = e_mapi_util_profile_name (&empd, FALSE);
- conn = exchange_mapi_connection_new (profname, empd.password, &error);
+ conn = e_mapi_connection_new (profname, empd.password, &error);
if (conn) {
- status = exchange_mapi_connection_connected (conn);
+ status = e_mapi_connection_connected (conn);
g_object_unref (conn);
}
@@ -1280,10 +1280,10 @@ mapi_account_changed_async (gpointer worker_data, gboolean cancelled, gpointer u
{
CamelURL *new_url = NULL, *old_url = NULL;
gboolean isa_mapi_account = FALSE;
- ExchangeMAPIAccountInfo *existing_account_info = NULL;
+ EMapiAccountInfo *existing_account_info = NULL;
EAccountList *account_listener = worker_data;
EAccount *account = user_data;
- ExchangeMapiProfileData empd = { 0 };
+ EMapiProfileData empd = { 0 };
CamelSettings *settings;
g_return_if_fail (account_listener != NULL);
@@ -1310,12 +1310,12 @@ mapi_account_changed_async (gpointer worker_data, gboolean cancelled, gpointer u
if (create_profile_entry (new_url, account, CAMEL_MAPI_SETTINGS (settings))) {
/* Things are successful */
gchar *profname = NULL, *uri = NULL;
- ExchangeMAPIAccountListener *config_listener = exchange_mapi_accounts_peek_config_listener();
+ EMapiAccountListener *config_listener = e_mapi_accounts_peek_config_listener();
empd.server = new_url->host;
empd.username = new_url->user;
- exchange_mapi_util_profiledata_from_settings (&empd, CAMEL_MAPI_SETTINGS (settings));
- profname = exchange_mapi_util_profile_name (&empd,
+ e_mapi_util_profiledata_from_settings (&empd, CAMEL_MAPI_SETTINGS (settings));
+ profname = e_mapi_util_profile_name (&empd,
FALSE);
camel_mapi_settings_set_profile (CAMEL_MAPI_SETTINGS (settings), profname);
camel_settings_save_to_url (settings, new_url);
@@ -1348,12 +1348,12 @@ mapi_account_changed_async (gpointer worker_data, gboolean cancelled, gpointer u
if (create_profile_entry (new_url, account, CAMEL_MAPI_SETTINGS (settings))) {
/* Things are successful */
gchar *profname = NULL, *uri = NULL;
- ExchangeMAPIAccountListener *config_listener = exchange_mapi_accounts_peek_config_listener();
+ EMapiAccountListener *config_listener = e_mapi_accounts_peek_config_listener();
empd.server = new_url->host;
empd.username = new_url->user;
- exchange_mapi_util_profiledata_from_settings (&empd, CAMEL_MAPI_SETTINGS (settings));
- profname = exchange_mapi_util_profile_name (&empd, FALSE);
+ e_mapi_util_profiledata_from_settings (&empd, CAMEL_MAPI_SETTINGS (settings));
+ profname = e_mapi_util_profile_name (&empd, FALSE);
camel_mapi_settings_set_profile (CAMEL_MAPI_SETTINGS (settings), profname);
camel_settings_save_to_url (settings, new_url);
g_free (profname);
@@ -1388,11 +1388,11 @@ mapi_account_changed (EAccountList *account_listener, EAccount *account)
{
g_return_if_fail (async_ops != NULL);
- em_async_queue_push (async_ops, g_object_ref (account_listener), g_object_ref (account), mapi_account_changed_async, NULL);
+ e_mapi_async_queue_push (async_ops, g_object_ref (account_listener), g_object_ref (account), mapi_account_changed_async, NULL);
}
static void
-exchange_mapi_account_listener_construct (ExchangeMAPIAccountListener *config_listener)
+e_mapi_account_listener_construct (EMapiAccountListener *config_listener)
{
EIterator *iter;
@@ -1401,7 +1401,7 @@ exchange_mapi_account_listener_construct (ExchangeMAPIAccountListener *config_li
for (iter = e_list_get_iterator (E_LIST(config_listener->priv->account_list)); e_iterator_is_valid (iter); e_iterator_next (iter)) {
EAccount *account = E_ACCOUNT (e_iterator_get (iter));
if (is_mapi_account (account)) {
- ExchangeMAPIAccountInfo *info = g_new0 (ExchangeMAPIAccountInfo, 1);
+ EMapiAccountInfo *info = g_new0 (EMapiAccountInfo, 1);
info->uid = g_strdup (account->uid);
info->name = g_strdup (account->name);
info->source_url = g_strdup (account->source->url);
@@ -1419,29 +1419,29 @@ exchange_mapi_account_listener_construct (ExchangeMAPIAccountListener *config_li
}
}
- d(exchange_mapi_debug_print ("MAPI listener is constructed with %d listed MAPI accounts ", g_list_length (mapi_accounts)));
+ d(e_mapi_debug_print ("MAPI listener is constructed with %d listed MAPI accounts ", g_list_length (mapi_accounts)));
g_signal_connect (config_listener->priv->account_list, "account_added", G_CALLBACK (mapi_account_added), NULL);
g_signal_connect (config_listener->priv->account_list, "account_changed", G_CALLBACK (mapi_account_changed), NULL);
g_signal_connect (config_listener->priv->account_list, "account_removed", G_CALLBACK (mapi_account_removed), NULL);
}
-ExchangeMAPIAccountListener *
-exchange_mapi_account_listener_new (void)
+EMapiAccountListener *
+e_mapi_account_listener_new (void)
{
- ExchangeMAPIAccountListener *config_listener;
+ EMapiAccountListener *config_listener;
if (!async_ops) {
- async_ops = em_async_queue_new ();
+ async_ops = e_mapi_async_queue_new ();
g_object_add_weak_pointer (G_OBJECT (async_ops), &async_ops);
} else {
g_object_ref (async_ops);
}
- config_listener = g_object_new (EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE, NULL);
+ config_listener = g_object_new (E_MAPI_ACCOUNT_LISTENER_TYPE, NULL);
config_listener->priv->gconf_client = gconf_client_get_default();
- exchange_mapi_account_listener_construct (config_listener);
+ e_mapi_account_listener_construct (config_listener);
return config_listener;
}
diff --git a/src/account-setup-eplugin/e-mapi-account-listener.h b/src/account-setup-eplugin/e-mapi-account-listener.h
new file mode 100644
index 0000000..ff65549
--- /dev/null
+++ b/src/account-setup-eplugin/e-mapi-account-listener.h
@@ -0,0 +1,57 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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/>
+ *
+ *
+ * Authors:
+ * Srinivasa Ragavan <sragavan novell com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#ifndef E_MAPI_ACCOUNT_LISTENER_H
+#define E_MAPI_ACCOUNT_LISTENER_H
+
+#include <glib.h>
+#include <glib-object.h>
+#include <camel/camel.h>
+G_BEGIN_DECLS
+
+#define E_MAPI_ACCOUNT_LISTENER_TYPE (e_mapi_account_listener_get_type ())
+#define E_MAPI_ACCOUNT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_MAPI_ACCOUNT_LISTENER_TYPE, EMapiAccountListener))
+#define E_MAPI_ACCOUNT_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_MAPI_ACCOUNT_LISTENER_TYPE, EMapiAccountListenerClass))
+#define E_MAPI_IS_ACCOUNT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_MAPI_ACCOUNT_LISTENER_TYPE))
+#define E_MAPI_IS_ACCOUNT_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_MAPI_ACCOUNT_LISTENER_TYPE))
+
+typedef struct _EMapiAccountListener EMapiAccountListener;
+typedef struct _EMapiAccountListenerClass EMapiAccountListenerClass;
+typedef struct _EMapiAccountListenerPrivate EMapiAccountListenerPrivate;
+
+struct _EMapiAccountListener {
+ GObject parent;
+ EMapiAccountListenerPrivate *priv;
+};
+
+struct _EMapiAccountListenerClass {
+ GObjectClass parent_class;
+};
+
+void e_mapi_add_esource (CamelService *service, const gchar *folder_name, const gchar *fid, gint folder_type);
+void e_mapi_remove_esource (CamelService *service, const gchar *folder_name, const gchar *fid, gint folder_type);
+GType e_mapi_account_listener_get_type (void);
+EMapiAccountListener * e_mapi_account_listener_new (void);
+
+G_END_DECLS
+
+#endif /* E_MAPI_ACCOUNT_LISTENER_H */
diff --git a/src/account-setup-eplugin/exchange-mapi-account-settings.c b/src/account-setup-eplugin/e-mapi-account-settings.c
similarity index 94%
rename from src/account-setup-eplugin/exchange-mapi-account-settings.c
rename to src/account-setup-eplugin/e-mapi-account-settings.c
index ad6be9c..54db85f 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-settings.c
+++ b/src/account-setup-eplugin/e-mapi-account-settings.c
@@ -35,9 +35,9 @@
#include <e-util/e-dialog-utils.h>
#include <e-util/e-plugin-ui.h>
-#include <exchange-mapi-folder.h>
-#include <exchange-mapi-connection.h>
-#include <exchange-mapi-utils.h>
+#include <e-mapi-folder.h>
+#include <e-mapi-connection.h>
+#include <e-mapi-utils.h>
#include <shell/e-shell-sidebar.h>
#include <shell/e-shell-view.h>
@@ -47,14 +47,14 @@
#include <mail/em-config.h>
#include <mail/em-folder-tree.h>
-#include "exchange-mapi-account-listener.h"
+#include "e-mapi-account-listener.h"
#define FOLDERSIZE_MENU_ITEM 0
gboolean e_plugin_ui_init (GtkUIManager *ui_manager,
EShellView *shell_view);
-GtkWidget *org_gnome_exchange_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data);
+GtkWidget *org_gnome_e_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data);
enum {
COL_FOLDERSIZE_NAME = 0,
@@ -70,7 +70,7 @@ typedef struct
gchar *profile;
GSList *folder_list;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
} FolderSizeDialogData;
static gboolean
@@ -110,7 +110,7 @@ fill_folder_size_dialog_cb (gpointer data)
/* Populate model with data */
while (dialog_data->folder_list) {
- ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *) dialog_data->folder_list->data;
+ EMapiFolder *folder = (EMapiFolder *) dialog_data->folder_list->data;
gchar *folder_size = g_format_size_for_display (folder->size);
gtk_list_store_append (store, &iter);
@@ -146,9 +146,9 @@ mapi_settings_get_folder_size (gpointer data)
FolderSizeDialogData *dialog_data = (FolderSizeDialogData *)data;
dialog_data->folder_list = NULL;
- dialog_data->conn = exchange_mapi_connection_find (dialog_data->profile);
- if (dialog_data->conn && exchange_mapi_connection_connected (dialog_data->conn))
- dialog_data->folder_list = exchange_mapi_connection_peek_folders_list (dialog_data->conn);
+ dialog_data->conn = e_mapi_connection_find (dialog_data->profile);
+ if (dialog_data->conn && e_mapi_connection_connected (dialog_data->conn))
+ dialog_data->folder_list = e_mapi_connection_peek_folders_list (dialog_data->conn);
g_timeout_add (100, fill_folder_size_dialog_cb, dialog_data);
@@ -326,7 +326,7 @@ folder_size_actions_update_cb (EShellView *shell_view, GtkActionEntry *entries)
/* used only in Account Editor */
GtkWidget *
-org_gnome_exchange_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data)
+org_gnome_e_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data)
{
EMConfigTargetAccount *target_account;
CamelURL *url;
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.c b/src/account-setup-eplugin/e-mapi-account-setup.c
similarity index 85%
rename from src/account-setup-eplugin/exchange-mapi-account-setup.c
rename to src/account-setup-eplugin/e-mapi-account-setup.c
index d052878..093009d 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.c
+++ b/src/account-setup-eplugin/e-mapi-account-setup.c
@@ -36,36 +36,36 @@
#include <libedataserver/e-account.h>
#include <e-util/e-dialog-utils.h>
#include "mail/em-config.h"
-#include "exchange-mapi-account-setup.h"
+#include "e-mapi-account-setup.h"
#include <addressbook/gui/widgets/eab-config.h>
#include <calendar/gui/e-cal-config.h>
#include <shell/e-shell.h>
-#include <exchange-mapi-folder.h>
-#include <exchange-mapi-connection.h>
-#include <exchange-mapi-utils.h>
+#include <e-mapi-folder.h>
+#include <e-mapi-connection.h>
+#include <e-mapi-utils.h>
#define d(x)
gint e_plugin_lib_enable (EPlugin *ep, gint enable);
/* Account Setup */
-GtkWidget *org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData *data);
-gboolean org_gnome_exchange_mapi_check_options(EPlugin *epl, EConfigHookPageCheckData *data);
+GtkWidget *org_gnome_e_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData *data);
+gboolean org_gnome_e_mapi_check_options(EPlugin *epl, EConfigHookPageCheckData *data);
/* New Addressbook/CAL */
-GtkWidget *exchange_mapi_create_addressbook (EPlugin *epl, EConfigHookItemFactoryData *data);
-GtkWidget *exchange_mapi_create_calendar (EPlugin *epl, EConfigHookItemFactoryData *data);
+GtkWidget *e_mapi_create_addressbook (EPlugin *epl, EConfigHookItemFactoryData *data);
+GtkWidget *e_mapi_create_calendar (EPlugin *epl, EConfigHookItemFactoryData *data);
/* New Addressbook */
-gboolean exchange_mapi_book_check (EPlugin *epl, EConfigHookPageCheckData *data);
-void exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target);
+gboolean e_mapi_book_check (EPlugin *epl, EConfigHookPageCheckData *data);
+void e_mapi_book_commit (EPlugin *epl, EConfigTarget *target);
/* New calendar/task list/memo list */
-gboolean exchange_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data);
-void exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target);
+gboolean e_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data);
+void e_mapi_cal_commit (EPlugin *epl, EConfigTarget *target);
-static ExchangeMAPIAccountListener *config_listener = NULL;
+static EMapiAccountListener *config_listener = NULL;
static void
free_mapi_listener ( void )
@@ -76,18 +76,18 @@ free_mapi_listener ( void )
gint
e_plugin_lib_enable (EPlugin *ep, gint enable)
{
- d(exchange_mapi_debug_print ("Loading Exchange MAPI Plugin"));
+ d(e_mapi_debug_print ("Loading Exchange MAPI Plugin"));
if (!config_listener) {
- config_listener = exchange_mapi_account_listener_new ();
+ config_listener = e_mapi_account_listener_new ();
g_atexit ( free_mapi_listener );
}
return 0;
}
-ExchangeMAPIAccountListener *
-exchange_mapi_accounts_peek_config_listener ()
+EMapiAccountListener *
+e_mapi_accounts_peek_config_listener ()
{
return config_listener;
}
@@ -267,7 +267,7 @@ validate_credentials (GtkWidget *widget, EConfig *config)
EMConfigTargetAccount *target_account = (EMConfigTargetAccount *)(config->target);
CamelURL *url = NULL;
gchar *key = NULL;
- ExchangeMapiProfileData empd = { 0 };
+ EMapiProfileData empd = { 0 };
CamelMapiSettings *mapi_settings;
GError *error = NULL;
@@ -292,7 +292,7 @@ validate_credentials (GtkWidget *widget, EConfig *config)
empd.server = url->host;
empd.username = url->user;
- exchange_mapi_util_profiledata_from_settings (&empd, mapi_settings);
+ e_mapi_util_profiledata_from_settings (&empd, mapi_settings);
if (!empd.username || !*(empd.username)
|| !empd.server || !*(empd.server)
@@ -309,29 +309,29 @@ validate_credentials (GtkWidget *widget, EConfig *config)
key = camel_url_to_string (url, CAMEL_URL_HIDE_PARAMS);
if (empd.krb_sso) {
- exchange_mapi_util_trigger_krb_auth (&empd, &error);
+ e_mapi_util_trigger_krb_auth (&empd, &error);
} else {
empd.password = prompt_password(empd.username, empd.server,
key, target_account);
}
if (COMPLETE_PROFILEDATA(&empd)) {
- gboolean status = exchange_mapi_create_profile (&empd,
+ gboolean status = e_mapi_create_profile (&empd,
(mapi_profile_callback_t) create_profile_callback,
empd.username,
&error);
if (status) {
/* profile was created, try to connect to the server */
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
gchar *profname;
status = FALSE;
- profname = exchange_mapi_util_profile_name (&empd,
+ profname = e_mapi_util_profile_name (&empd,
FALSE);
- conn = exchange_mapi_connection_new (profname, empd.password, &error);
+ conn = e_mapi_connection_new (profname, empd.password, &error);
if (conn) {
- status = exchange_mapi_connection_connected (conn);
+ status = e_mapi_connection_connected (conn);
g_object_unref (conn);
}
@@ -342,7 +342,7 @@ validate_credentials (GtkWidget *widget, EConfig *config)
/* Things are successful */
gchar *profname = NULL;
- profname = exchange_mapi_util_profile_name (&empd,
+ profname = e_mapi_util_profile_name (&empd,
FALSE);
camel_mapi_settings_set_profile (mapi_settings, profname);
g_free (profname);
@@ -374,7 +374,7 @@ validate_credentials (GtkWidget *widget, EConfig *config)
}
GtkWidget *
-org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData *data)
+org_gnome_e_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData *data)
{
EMConfigTargetAccount *target_account;
CamelSettings *settings;
@@ -480,7 +480,7 @@ org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData
}
gboolean
-org_gnome_exchange_mapi_check_options(EPlugin *epl, EConfigHookPageCheckData *data)
+org_gnome_e_mapi_check_options(EPlugin *epl, EConfigHookPageCheckData *data)
{
EMConfigTargetAccount *target = (EMConfigTargetAccount *)(data->config->target);
gboolean status = TRUE;
@@ -514,7 +514,7 @@ enum {
};
static gboolean
-check_node (GtkTreeStore *ts, ExchangeMAPIFolder *folder, GtkTreeIter iter)
+check_node (GtkTreeStore *ts, EMapiFolder *folder, GtkTreeIter iter)
{
GtkTreeModel *ts_model;
mapi_id_t fid;
@@ -545,7 +545,7 @@ check_node (GtkTreeStore *ts, ExchangeMAPIFolder *folder, GtkTreeIter iter)
}
static void
-add_to_store (GtkTreeStore *ts, ExchangeMAPIFolder *folder)
+add_to_store (GtkTreeStore *ts, EMapiFolder *folder)
{
GtkTreeModel *ts_model;
GtkTreeIter iter;
@@ -561,7 +561,7 @@ add_to_store (GtkTreeStore *ts, ExchangeMAPIFolder *folder)
}
static void
-traverse_tree (GtkTreeModel *model, GtkTreeIter iter, ExchangeMAPIFolderType folder_type, gboolean *pany_sub_used)
+traverse_tree (GtkTreeModel *model, GtkTreeIter iter, EMapiFolderType folder_type, gboolean *pany_sub_used)
{
gboolean any_sub_used = FALSE;
gboolean has_next = TRUE;
@@ -569,7 +569,7 @@ traverse_tree (GtkTreeModel *model, GtkTreeIter iter, ExchangeMAPIFolderType fol
do {
gboolean sub_used = FALSE;
GtkTreeIter next = iter;
- ExchangeMAPIFolder *folder = NULL;
+ EMapiFolder *folder = NULL;
has_next = gtk_tree_model_iter_next (model, &next);
@@ -581,7 +581,7 @@ traverse_tree (GtkTreeModel *model, GtkTreeIter iter, ExchangeMAPIFolderType fol
}
gtk_tree_model_get (model, &iter, FOLDER_COL, &folder, -1);
- if (folder && (exchange_mapi_folder_get_type (folder) == folder_type || (folder_type == MAPI_FOLDER_TYPE_MEMO && exchange_mapi_folder_get_type (folder) == MAPI_FOLDER_TYPE_JOURNAL))) {
+ if (folder && (e_mapi_folder_get_type (folder) == folder_type || (folder_type == MAPI_FOLDER_TYPE_MEMO && e_mapi_folder_get_type (folder) == MAPI_FOLDER_TYPE_JOURNAL))) {
sub_used = TRUE;
}
@@ -598,7 +598,7 @@ traverse_tree (GtkTreeModel *model, GtkTreeIter iter, ExchangeMAPIFolderType fol
}
static void
-add_folders (GSList *folders, GtkTreeStore *ts, ExchangeMAPIFolderType folder_type)
+add_folders (GSList *folders, GtkTreeStore *ts, EMapiFolderType folder_type)
{
GSList *tmp = folders;
GtkTreeIter iter;
@@ -608,7 +608,7 @@ add_folders (GSList *folders, GtkTreeStore *ts, ExchangeMAPIFolderType folder_ty
gtk_tree_store_append (ts, &iter, NULL);
gtk_tree_store_set (ts, &iter, NAME_COL, node, -1);
while (tmp) {
- ExchangeMAPIFolder *folder = tmp->data;
+ EMapiFolder *folder = tmp->data;
add_to_store (ts, folder);
tmp = tmp->next;
}
@@ -632,11 +632,11 @@ select_folder (GtkTreeModel *model, mapi_id_t fid, GtkWidget *tree_view)
return;
while (!found && can) {
- ExchangeMAPIFolder *folder = NULL;
+ EMapiFolder *folder = NULL;
gtk_tree_model_get (model, &iter, FOLDER_COL, &folder, -1);
- if (folder && exchange_mapi_folder_get_fid (folder) == fid) {
+ if (folder && e_mapi_folder_get_fid (folder) == fid) {
gtk_tree_selection_select_iter (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)), &iter);
found = TRUE;
break;
@@ -672,7 +672,7 @@ select_folder (GtkTreeModel *model, mapi_id_t fid, GtkWidget *tree_view)
}
static void
-exchange_mapi_cursor_change (GtkTreeView *treeview, ESource *source)
+e_mapi_cursor_change (GtkTreeView *treeview, ESource *source)
{
GtkTreeSelection *selection;
GtkTreeModel *model;
@@ -683,7 +683,7 @@ exchange_mapi_cursor_change (GtkTreeView *treeview, ESource *source)
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
gtk_tree_model_get (model, &iter, FID_COL, &pfid, -1);
- sfid = exchange_mapi_util_mapi_id_to_string (pfid);
+ sfid = e_mapi_util_mapi_id_to_string (pfid);
e_source_set_property (source, "parent-fid", sfid);
g_free (sfid);
} else {
@@ -692,7 +692,7 @@ exchange_mapi_cursor_change (GtkTreeView *treeview, ESource *source)
}
static GtkWidget *
-exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType folder_type)
+e_mapi_create (GtkWidget *parent, ESource *source, EMapiFolderType folder_type)
{
GtkWidget *table, *label, *scroll, *tv;
gchar *uri_text, *profile = NULL;
@@ -703,7 +703,7 @@ exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType
GtkTreeViewColumn *tvc;
const gchar *acc;
GSList *folders;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
mapi_id_t fid = 0;
uri_text = e_source_get_uri (source);
@@ -718,10 +718,10 @@ exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType
profile = e_source_group_get_property (group, "profile");
e_source_set_property (source, "profile", profile);
}
- conn = exchange_mapi_connection_find (profile);
+ conn = e_mapi_connection_find (profile);
g_free (profile);
- if (conn && exchange_mapi_connection_connected (conn))
- folders = exchange_mapi_connection_peek_folders_list (conn);
+ if (conn && e_mapi_connection_connected (conn))
+ folders = e_mapi_connection_peek_folders_list (conn);
acc = e_source_group_peek_name (group);
ts = gtk_tree_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_INT64, G_TYPE_POINTER);
@@ -752,7 +752,7 @@ exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType
gtk_tree_view_expand_all (GTK_TREE_VIEW (tv));
if (e_source_get_property (source, "folder-id")) {
- exchange_mapi_util_mapi_id_from_string (e_source_get_property (source, "folder-id"), &fid);
+ e_mapi_util_mapi_id_from_string (e_source_get_property (source, "folder-id"), &fid);
select_folder (GTK_TREE_MODEL (ts), fid, tv);
}
@@ -762,7 +762,7 @@ exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType
g_object_set (scroll, "height-request", 150, NULL);
gtk_container_add (GTK_CONTAINER (scroll), tv);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), tv);
- g_signal_connect (G_OBJECT (tv), "cursor-changed", G_CALLBACK (exchange_mapi_cursor_change), source);
+ g_signal_connect (G_OBJECT (tv), "cursor-changed", G_CALLBACK (e_mapi_cursor_change), source);
gtk_widget_show_all (scroll);
gtk_table_attach (GTK_TABLE (table), scroll, 0, 1, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
@@ -773,18 +773,18 @@ exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType
}
GtkWidget *
-exchange_mapi_create_addressbook (EPlugin *epl, EConfigHookItemFactoryData *data)
+e_mapi_create_addressbook (EPlugin *epl, EConfigHookItemFactoryData *data)
{
EABConfigTargetSource *t = (EABConfigTargetSource *) data->target;
- return exchange_mapi_create (data->parent, t->source, MAPI_FOLDER_TYPE_CONTACT);
+ return e_mapi_create (data->parent, t->source, MAPI_FOLDER_TYPE_CONTACT);
}
GtkWidget *
-exchange_mapi_create_calendar (EPlugin *epl, EConfigHookItemFactoryData *data)
+e_mapi_create_calendar (EPlugin *epl, EConfigHookItemFactoryData *data)
{
ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target;
- ExchangeMAPIFolderType folder_type;
+ EMapiFolderType folder_type;
switch (t->source_type) {
case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
@@ -800,11 +800,11 @@ exchange_mapi_create_calendar (EPlugin *epl, EConfigHookItemFactoryData *data)
g_return_val_if_reached (NULL);
}
- return exchange_mapi_create (data->parent, t->source, folder_type);
+ return e_mapi_create (data->parent, t->source, folder_type);
}
gboolean
-exchange_mapi_book_check (EPlugin *epl, EConfigHookPageCheckData *data)
+e_mapi_book_check (EPlugin *epl, EConfigHookPageCheckData *data)
{
EABConfigTargetSource *t = (EABConfigTargetSource *) data->target;
ESource *source = t->source;
@@ -832,14 +832,14 @@ exchange_mapi_book_check (EPlugin *epl, EConfigHookPageCheckData *data)
}
void
-exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
+e_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
{
EABConfigTargetSource *t = (EABConfigTargetSource *) target;
ESource *source = t->source;
gchar *uri_text, *r_uri, *sfid;
const gchar *kerberos = NULL;
ESourceGroup *grp;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
mapi_id_t fid, pfid;
GError *mapi_error = NULL;
@@ -847,13 +847,13 @@ exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
if (uri_text && g_ascii_strncasecmp (uri_text, MAPI_URI_PREFIX, MAPI_PREFIX_LENGTH))
return;
- exchange_mapi_util_mapi_id_from_string (e_source_get_property (source, "parent-fid"), &pfid);
+ e_mapi_util_mapi_id_from_string (e_source_get_property (source, "parent-fid"), &pfid);
/* the profile should be already connected */
- conn = exchange_mapi_connection_find (e_source_get_property (source, "profile"));
+ conn = e_mapi_connection_find (e_source_get_property (source, "profile"));
g_return_if_fail (conn != NULL);
- fid = exchange_mapi_connection_create_folder (conn, olFolderContacts, pfid, 0, e_source_peek_name (source), &mapi_error);
+ fid = e_mapi_connection_create_folder (conn, olFolderContacts, pfid, 0, e_source_peek_name (source), &mapi_error);
g_object_unref (conn);
if (!fid) {
@@ -867,7 +867,7 @@ exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
return;
}
- sfid = exchange_mapi_util_mapi_id_to_string (fid);
+ sfid = e_mapi_util_mapi_id_to_string (fid);
r_uri = g_strconcat (";", sfid, NULL);
e_source_set_relative_uri (source, r_uri);
@@ -892,7 +892,7 @@ exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
e_source_set_property (source, "public", "no");
e_source_set_property (source, "folder-id", sfid);
- // Update the folder list in the plugin and ExchangeMAPIFolder
+ // Update the folder list in the plugin and EMapiFolder
g_free (r_uri);
g_free (sfid);
@@ -901,7 +901,7 @@ exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
/* New calendar/task list/memo list */
gboolean
-exchange_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data)
+e_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data)
{
ECalConfigTargetSource *t = (ECalConfigTargetSource *)(data->target);
ESource *source = t->source;
@@ -930,9 +930,9 @@ exchange_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data)
}
void
-exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
+e_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
{
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
ECalConfigTargetSource *t = (ECalConfigTargetSource *) target;
ESourceGroup *group;
ESource *source = t->source;
@@ -957,19 +957,19 @@ exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
type = olFolderNotes;
break;
default:
- g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
+ g_warning ("%s: %s: Unknown EMapiFolderType\n", G_STRLOC, G_STRFUNC);
return;
}
/* FIXME: Offline handling */
- exchange_mapi_util_mapi_id_from_string (e_source_get_property (source, "parent-fid"), &pfid);
+ e_mapi_util_mapi_id_from_string (e_source_get_property (source, "parent-fid"), &pfid);
/* the profile should be already connected */
- conn = exchange_mapi_connection_find (e_source_get_property (source, "profile"));
+ conn = e_mapi_connection_find (e_source_get_property (source, "profile"));
g_return_if_fail (conn != NULL);
- fid = exchange_mapi_connection_create_folder (conn, type, pfid, 0, e_source_peek_name (source), &mapi_error);
+ fid = e_mapi_connection_create_folder (conn, type, pfid, 0, e_source_peek_name (source), &mapi_error);
g_object_unref (conn);
if (!fid) {
@@ -983,7 +983,7 @@ exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
return;
}
- sfid = exchange_mapi_util_mapi_id_to_string (fid);
+ sfid = e_mapi_util_mapi_id_to_string (fid);
tmp = g_strconcat (";", sfid, NULL);
e_source_set_relative_uri (source, tmp);
g_free (tmp);
@@ -1023,7 +1023,7 @@ exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
}
g_free (tmp);
- tmp = exchange_mapi_util_mapi_id_to_string (fid);
+ tmp = e_mapi_util_mapi_id_to_string (fid);
e_source_set_property (source, "folder-id", tmp);
g_free (tmp);
@@ -1043,6 +1043,6 @@ exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
e_source_set_property (source, "acl-owner-email", tmp);
g_free (tmp);
- // Update the folder list in the plugin and ExchangeMAPIFolder
+ // Update the folder list in the plugin and EMapiFolder
return;
}
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.h b/src/account-setup-eplugin/e-mapi-account-setup.h
similarity index 78%
rename from src/account-setup-eplugin/exchange-mapi-account-setup.h
rename to src/account-setup-eplugin/e-mapi-account-setup.h
index d5d5f96..e268dd6 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.h
+++ b/src/account-setup-eplugin/e-mapi-account-setup.h
@@ -21,15 +21,15 @@
*
*/
-#ifndef EXCHANGE_MAPI_ACCOUNT_SETUP_H
-#define EXCHANGE_MAPI_ACCOUNT_SETUP_H
+#ifndef E_MAPI_ACCOUNT_SETUP_H
+#define E_MAPI_ACCOUNT_SETUP_H
-#include "exchange-mapi-account-listener.h"
+#include "e-mapi-account-listener.h"
#define MAPI_URI_PREFIX "mapi://"
#define MAPI_PREFIX_LENGTH 7
-ExchangeMAPIAccountListener *
-exchange_mapi_accounts_peek_config_listener (void);
+EMapiAccountListener *
+e_mapi_accounts_peek_config_listener (void);
-#endif /* EXCHANGE_MAPI_ACCOUNT_SETUP_H */
+#endif /* E_MAPI_ACCOUNT_SETUP_H */
diff --git a/src/account-setup-eplugin/org-gnome-exchange-mapi.eplug.xml b/src/account-setup-eplugin/org-gnome-exchange-mapi.eplug.xml
index 9144a10..11ffa74 100644
--- a/src/account-setup-eplugin/org-gnome-exchange-mapi.eplug.xml
+++ b/src/account-setup-eplugin/org-gnome-exchange-mapi.eplug.xml
@@ -12,68 +12,68 @@
<group
target="account"
id="org.gnome.evolution.mail.config.accountWizard"
- check="org_gnome_exchange_mapi_check_options">
+ check="org_gnome_e_mapi_check_options">
<item
type="item_table"
path="10.receive/20.config/30.mapi"
- factory="org_gnome_exchange_mapi_account_setup"/>
+ factory="org_gnome_e_mapi_account_setup"/>
</group>
</hook>
<hook class="org.gnome.evolution.mail.config:1.0">
<group
target="account"
id="org.gnome.evolution.mail.config.accountAssistant"
- check="org_gnome_exchange_mapi_check_options">
+ check="org_gnome_e_mapi_check_options">
<item
type="item_table"
path="10.receive/20.config/30.mapi"
- factory="org_gnome_exchange_mapi_account_setup"/>
+ factory="org_gnome_e_mapi_account_setup"/>
</group>
</hook>
<hook class="org.gnome.evolution.mail.config:1.0">
<group
target="account"
id="org.gnome.evolution.mail.config.accountEditor"
- check="org_gnome_exchange_mapi_check_options">
+ check="org_gnome_e_mapi_check_options">
<item
type="item_table"
path="10.receive/20.config/30.mapi"
- factory="org_gnome_exchange_mapi_account_setup"/>
+ factory="org_gnome_e_mapi_account_setup"/>
</group>
</hook>
<hook class="org.gnome.evolution.mail.config:1.0">
<group
target="account"
id="org.gnome.evolution.mail.config.accountEditor"
- check="org_gnome_exchange_mapi_check_options">
+ check="org_gnome_e_mapi_check_options">
<item type="page"
path="40.settings"
_label="Exchange Settings"
- factory="org_gnome_exchange_mapi_settings"/>
+ factory="org_gnome_e_mapi_settings"/>
</group>
</hook>
<hook class="org.gnome.evolution.addressbook.config:1.0">
<group
target="source"
id="com.novell.evolution.addressbook.config.accountEditor"
- check="exchange_mapi_book_check"
- commit="exchange_mapi_book_commit">
+ check="e_mapi_book_check"
+ commit="e_mapi_book_commit">
<item
type="item"
path="00.general/10.display/50.createcontacts"
- factory="exchange_mapi_create_addressbook"/>
+ factory="e_mapi_create_addressbook"/>
</group>
</hook>
<hook class="org.gnome.evolution.calendar.config:1.0">
<group
target="source"
id="org.gnome.evolution.calendar.calendarProperties"
- check="exchange_mapi_cal_check"
- commit="exchange_mapi_cal_commit">
+ check="e_mapi_cal_check"
+ commit="e_mapi_cal_commit">
<item
type="item_table"
path="00.general/10.source/40.pcalendar"
- factory="exchange_mapi_create_calendar"/>
+ factory="e_mapi_create_calendar"/>
</group>
</hook>
diff --git a/src/addressbook/e-book-backend-mapi-contacts.c b/src/addressbook/e-book-backend-mapi-contacts.c
index c928939..ddc795e 100644
--- a/src/addressbook/e-book-backend-mapi-contacts.c
+++ b/src/addressbook/e-book-backend-mapi-contacts.c
@@ -94,7 +94,7 @@ build_restriction_emails_contains (struct mapi_SRestriction *res, const gchar *q
#if 0
static gboolean
-build_multiple_restriction_emails_contains (ExchangeMapiConnection *conn, mapi_id_t fid, struct mapi_SRestriction *res,
+build_multiple_restriction_emails_contains (EMapiConnection *conn, mapi_id_t fid, struct mapi_SRestriction *res,
struct mapi_SRestriction_or *or_res,
const gchar *query, gchar **to_free)
{
@@ -147,17 +147,17 @@ build_multiple_restriction_emails_contains (ExchangeMapiConnection *conn, mapi_i
or_res[3].rt = RES_CONTENT;
or_res[3].res.resContent.fuzzy = FL_FULLSTRING | FL_IGNORECASE;
- or_res[3].res.resContent.ulPropTag = exchange_mapi_connection_resolve_named_prop (conn, fid, PidLidEmail1OriginalDisplayName, NULL);
+ or_res[3].res.resContent.ulPropTag = e_mapi_connection_resolve_named_prop (conn, fid, PidLidEmail1OriginalDisplayName, NULL);
or_res[3].res.resContent.lpProp.value.lpszA = email;
or_res[4].rt = RES_CONTENT;
or_res[4].res.resContent.fuzzy = FL_FULLSTRING | FL_IGNORECASE;
- or_res[4].res.resContent.ulPropTag = exchange_mapi_connection_resolve_named_prop (conn, fid, PidLidEmail2OriginalDisplayName, NULL);
+ or_res[4].res.resContent.ulPropTag = e_mapi_connection_resolve_named_prop (conn, fid, PidLidEmail2OriginalDisplayName, NULL);
or_res[4].res.resContent.lpProp.value.lpszA = email;
or_res[5].rt = RES_CONTENT;
or_res[5].res.resContent.fuzzy = FL_FULLSTRING | FL_IGNORECASE;
- or_res[5].res.resContent.ulPropTag = exchange_mapi_connection_resolve_named_prop (conn, fid, PidLidEmail3OriginalDisplayName, NULL);
+ or_res[5].res.resContent.ulPropTag = e_mapi_connection_resolve_named_prop (conn, fid, PidLidEmail3OriginalDisplayName, NULL);
or_res[5].res.resContent.lpProp.value.lpszA = email;
res = g_new0 (struct mapi_SRestriction, 1);
@@ -229,7 +229,7 @@ typedef struct {
} MapiCreateitemData;
static gboolean
-mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data)
+mapi_book_write_props (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data)
{
/* Do not make this array static, below function modifies it.
The array is used to just ensure named ids are known later. */
@@ -255,12 +255,12 @@ mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *
MapiCreateitemData *mcd = data;
#define set_str_value(hex, val) G_STMT_START { \
- if (!exchange_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, val ? val : "")) \
+ if (!e_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, val ? val : "")) \
return FALSE; \
} G_STMT_END
#define set_str_named_value(named_id, val) G_STMT_START { \
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, named_id, val ? val : "")) \
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, named_id, val ? val : "")) \
return FALSE; \
} G_STMT_END
@@ -282,7 +282,7 @@ mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *
g_return_val_if_fail (values != NULL, FALSE);
g_return_val_if_fail (n_values != NULL, FALSE);
- if (!exchange_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL))
+ if (!e_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL))
return FALSE;
if (GPOINTER_TO_INT (e_contact_get (mcd->contact, E_CONTACT_IS_LIST))) {
@@ -331,7 +331,7 @@ mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *
set_str_value (PR_MESSAGE_CLASS, IPM_DISTLIST);
u32 = 0xFFFFFFFF;
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, PidLidFileUnderId, &u32))
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, PidLidFileUnderId, &u32))
return FALSE;
set_str_named_con_value (PidLidFileUnder, E_CONTACT_FILE_AS);
set_str_named_con_value (PidLidDistributionListName, E_CONTACT_FILE_AS);
@@ -374,15 +374,15 @@ mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *
members->lpbin[members->cValues].cb = string_to_bin (mem_ctx, g_hash_table_lookup (member_values, raw), &members->lpbin[members->cValues].lpb);
members->cValues++;
} else {
- exchange_mapi_util_recip_entryid_generate_smtp (mem_ctx, &members->lpbin[members->cValues], nm ? nm : "", eml);
+ e_mapi_util_recip_entryid_generate_smtp (mem_ctx, &members->lpbin[members->cValues], nm ? nm : "", eml);
members->cValues++;
}
- exchange_mapi_util_recip_entryid_generate_smtp (mem_ctx, &oneoff_members->lpbin[oneoff_members->cValues], nm ? nm : "", eml);
+ e_mapi_util_recip_entryid_generate_smtp (mem_ctx, &oneoff_members->lpbin[oneoff_members->cValues], nm ? nm : "", eml);
oneoff_members->cValues++;
list_size += MAX (oneoff_members->lpbin[oneoff_members->cValues - 1].cb, members->lpbin[members->cValues - 1].cb);
- crc32 = exchange_mapi_utils_push_crc32 (crc32, members->lpbin[members->cValues - 1].lpb, members->lpbin[members->cValues - 1].cb);
+ crc32 = e_mapi_utils_push_crc32 (crc32, members->lpbin[members->cValues - 1].lpb, members->lpbin[members->cValues - 1].cb);
}
}
@@ -397,15 +397,15 @@ mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *
g_list_foreach (local, (GFunc)e_vcard_attribute_free, NULL);
g_list_free (local);
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values,
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values,
PidLidDistributionListOneOffMembers, oneoff_members))
return FALSE;
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values,
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values,
PidLidDistributionListMembers, members))
return FALSE;
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values,
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values,
PidLidDistributionListChecksum, &crc32))
return FALSE;
@@ -465,9 +465,9 @@ mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *
tmtime.tm_mon = date->month - 1;
tmtime.tm_year = date->year - 1900;
- exchange_mapi_util_time_t_to_filetime (mktime (&tmtime) + (24 * 60 * 60), &t);
+ e_mapi_util_time_t_to_filetime (mktime (&tmtime) + (24 * 60 * 60), &t);
- if (!exchange_mapi_utils_add_spropvalue (mem_ctx, values, n_values, PR_BIRTHDAY, &t))
+ if (!e_mapi_utils_add_spropvalue (mem_ctx, values, n_values, PR_BIRTHDAY, &t))
return FALSE;
}
@@ -480,9 +480,9 @@ mapi_book_write_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *
tmtime.tm_mon = date->month - 1;
tmtime.tm_year = date->year - 1900;
- exchange_mapi_util_time_t_to_filetime (mktime (&tmtime) + (24 * 60 * 60), &t);
+ e_mapi_util_time_t_to_filetime (mktime (&tmtime) + (24 * 60 * 60), &t);
- if (!exchange_mapi_utils_add_spropvalue (mem_ctx, values, n_values, PR_WEDDING_ANNIVERSARY, &t))
+ if (!e_mapi_utils_add_spropvalue (mem_ctx, values, n_values, PR_WEDDING_ANNIVERSARY, &t))
return FALSE;
}
@@ -534,7 +534,7 @@ fetch_contact_item_cb (FetchItemsCallbackData *item_data, gpointer data)
fcid->contact = mapi_book_utils_contact_from_props (item_data->conn, item_data->fid, e_book_backend_mapi_get_book_uri (fcid->ebma), item_data->properties, NULL);
if (fcid->contact) {
- gchar *suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
+ gchar *suid = e_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
e_contact_set (fcid->contact, E_CONTACT_UID, suid);
@@ -568,7 +568,7 @@ create_contact_list_cb (FetchItemsCallbackData *item_data, gpointer data)
contact = mapi_book_utils_contact_from_props (item_data->conn, item_data->fid, e_book_backend_mapi_get_book_uri (ccld->ebma), item_data->properties, NULL);
if (contact) {
- gchar *suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
+ gchar *suid = e_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
e_contact_set (contact, E_CONTACT_UID, suid);
@@ -606,7 +606,7 @@ fetch_contacts_cb (FetchItemsCallbackData *item_data, gpointer data)
gchar *suid;
struct timeval *last_modification = NULL, tv = { 0 };
- suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
+ suid = e_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
e_contact_set (contact, E_CONTACT_UID, suid);
g_free (suid);
@@ -638,7 +638,7 @@ fetch_contacts_uids_cb (FetchItemsCallbackData *item_data, gpointer data)
g_return_val_if_fail (data != NULL, FALSE);
- suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
+ suid = e_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
if (suid)
g_hash_table_insert (fcud->uids, suid, GINT_TO_POINTER (1));
@@ -661,7 +661,7 @@ ebbm_contacts_open (EBookBackendMAPI *ebma, GCancellable *cancellable, gboolean
priv->fid = 0;
priv->is_public_folder = g_strcmp0 (e_source_get_property (source, "public"), "yes") == 0;
- exchange_mapi_util_mapi_id_from_string (e_source_get_property (source, "folder-id"), &priv->fid);
+ e_mapi_util_mapi_id_from_string (e_source_get_property (source, "folder-id"), &priv->fid);
/* Chain up to parent's op_load_source() method. */
if (E_BOOK_BACKEND_MAPI_CLASS (e_book_backend_mapi_contacts_parent_class)->op_open)
@@ -699,7 +699,7 @@ ebbm_contacts_remove (EBookBackendMAPI *ebma, GCancellable *cancellable, GError
}
if (!priv->is_public_folder) {
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
e_book_backend_mapi_lock_connection (ebma);
@@ -707,7 +707,7 @@ ebbm_contacts_remove (EBookBackendMAPI *ebma, GCancellable *cancellable, GError
if (!conn) {
g_propagate_error (error, EDB_ERROR (OFFLINE_UNAVAILABLE));
} else {
- exchange_mapi_connection_remove_folder (conn, priv->fid, 0, &mapi_error);
+ e_mapi_connection_remove_folder (conn, priv->fid, 0, &mapi_error);
if (mapi_error) {
mapi_error_to_edb_error (error, mapi_error, E_DATA_BOOK_STATUS_OTHER_ERROR, _("Failed to remove public folder"));
@@ -724,7 +724,7 @@ ebbm_contacts_create_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
{
EBookBackendMAPIContacts *ebmac;
EBookBackendMAPIContactsPrivate *priv;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
MapiCreateitemData mcd;
GError *mapi_error = NULL;
mapi_id_t mid;
@@ -766,7 +766,7 @@ ebbm_contacts_create_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
e_book_backend_mapi_get_db (ebma, &mcd.db);
mcd.contact = contact;
- mid = exchange_mapi_connection_create_item (conn, olFolderContacts, priv->fid,
+ mid = e_mapi_connection_create_item (conn, olFolderContacts, priv->fid,
mapi_book_write_props, &mcd,
NULL, NULL, NULL, MAPI_OPTIONS_DONT_SUBMIT | (priv->is_public_folder ? MAPI_OPTIONS_USE_PFSTORE : 0), &mapi_error);
@@ -782,7 +782,7 @@ ebbm_contacts_create_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
return;
}
- id = exchange_mapi_util_mapi_ids_to_uid (priv->fid, mid);
+ id = e_mapi_util_mapi_ids_to_uid (priv->fid, mid);
/* 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);
@@ -798,7 +798,7 @@ ebbm_contacts_remove_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
{
EBookBackendMAPIContacts *ebmac;
EBookBackendMAPIContactsPrivate *priv;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
GError *mapi_error = NULL;
GSList *to_remove;
const GSList *l;
@@ -829,7 +829,7 @@ ebbm_contacts_remove_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
const gchar *uid = l->data;
struct id_list *idl = g_new0 (struct id_list, 1);
- exchange_mapi_util_mapi_ids_from_uid (uid, &fid, &mid);
+ e_mapi_util_mapi_ids_from_uid (uid, &fid, &mid);
idl->id = mid;
to_remove = g_slist_prepend (to_remove, idl);
@@ -837,7 +837,7 @@ ebbm_contacts_remove_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
*removed_ids = g_slist_prepend (*removed_ids, g_strdup (uid));
}
- exchange_mapi_connection_remove_items (conn, olFolderContacts, priv->fid, priv->is_public_folder ? MAPI_OPTIONS_USE_PFSTORE : 0, to_remove, &mapi_error);
+ e_mapi_connection_remove_items (conn, olFolderContacts, priv->fid, priv->is_public_folder ? MAPI_OPTIONS_USE_PFSTORE : 0, to_remove, &mapi_error);
e_book_backend_mapi_unlock_connection (ebma);
@@ -860,7 +860,7 @@ ebbm_contacts_modify_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
{
EBookBackendMAPIContacts *ebmac;
EBookBackendMAPIContactsPrivate *priv;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
MapiCreateitemData mcd;
EContact *contact;
GError *mapi_error = NULL;
@@ -901,9 +901,9 @@ ebbm_contacts_modify_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
e_book_backend_mapi_get_db (ebma, &mcd.db);
mcd.contact = contact;
- exchange_mapi_util_mapi_ids_from_uid (e_contact_get_const (contact, E_CONTACT_UID), &fid, &mid);
+ e_mapi_util_mapi_ids_from_uid (e_contact_get_const (contact, E_CONTACT_UID), &fid, &mid);
- if (!exchange_mapi_connection_modify_item (conn, olFolderContacts, priv->fid, mid,
+ if (!e_mapi_connection_modify_item (conn, olFolderContacts, priv->fid, mid,
mapi_book_write_props, &mcd, NULL, NULL, NULL, priv->is_public_folder ? MAPI_OPTIONS_USE_PFSTORE : 0, &mapi_error)) {
mapi_error_to_edb_error (error, mapi_error, E_DATA_BOOK_STATUS_OTHER_ERROR, _("Failed to modify item on a server"));
@@ -923,7 +923,7 @@ ebbm_contacts_get_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, co
{
EBookBackendMAPIContacts *ebmac;
EBookBackendMAPIContactsPrivate *priv;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
mapi_id_t fid, mid;
guint32 options;
struct FetchContactItemData fcid = { 0 };
@@ -967,9 +967,9 @@ ebbm_contacts_get_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, co
fcid.ebma = ebma;
fcid.contact = NULL;
- exchange_mapi_util_mapi_ids_from_uid (id, &fid, &mid);
+ e_mapi_util_mapi_ids_from_uid (id, &fid, &mid);
- exchange_mapi_connection_fetch_item (conn, priv->fid, mid,
+ e_mapi_connection_fetch_item (conn, priv->fid, mid,
priv->is_public_folder ? NULL : mapi_book_utils_get_prop_list, GET_ALL_KNOWN_IDS,
fetch_contact_item_cb, &fcid,
options, &mapi_error);
@@ -996,7 +996,7 @@ ebbm_contacts_get_contact_list (EBookBackendMAPI *ebma, GCancellable *cancellabl
{
EBookBackendMAPIContacts *ebmac;
EBookBackendMAPIContactsPrivate *priv;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
guint32 options;
struct CreateContactListData ccld = { 0 };
GError *mapi_error = NULL;
@@ -1051,7 +1051,7 @@ ebbm_contacts_get_contact_list (EBookBackendMAPI *ebma, GCancellable *cancellabl
return;
}
- if (!exchange_mapi_connection_fetch_items (conn, priv->fid, get_all ? NULL : &res, NULL,
+ if (!e_mapi_connection_fetch_items (conn, priv->fid, get_all ? NULL : &res, NULL,
priv->is_public_folder ? NULL : mapi_book_utils_get_prop_list, GET_ALL_KNOWN_IDS,
create_contact_list_cb, &ccld, options, &mapi_error)) {
mapi_error_to_edb_error (error, mapi_error, E_DATA_BOOK_STATUS_OTHER_ERROR, _("Failed to fetch items from a server"));
@@ -1085,7 +1085,7 @@ ebbm_contacts_fetch_contacts (EBookBackendMAPI *ebma, struct mapi_SRestriction *
{
EBookBackendMAPIContacts *ebmac;
EBookBackendMAPIContactsPrivate *priv;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
guint32 options;
struct FetchContactsData fcd = { 0 };
GError *mapi_error = NULL;
@@ -1117,7 +1117,7 @@ ebbm_contacts_fetch_contacts (EBookBackendMAPI *ebma, struct mapi_SRestriction *
if (priv->is_public_folder)
options |= MAPI_OPTIONS_USE_PFSTORE;
- if (!exchange_mapi_connection_fetch_items (conn, priv->fid, restriction, NULL,
+ if (!e_mapi_connection_fetch_items (conn, priv->fid, restriction, NULL,
mapi_book_utils_get_prop_list, GET_ALL_KNOWN_IDS,
fetch_contacts_cb, &fcd, options, &mapi_error)) {
mapi_error_to_edb_error (error, mapi_error, E_DATA_BOOK_STATUS_OTHER_ERROR, _("Failed to fetch items from a server"));
@@ -1134,7 +1134,7 @@ ebbm_contacts_fetch_known_uids (EBookBackendMAPI *ebma, GCancellable *cancelled,
{
EBookBackendMAPIContacts *ebmac;
EBookBackendMAPIContactsPrivate *priv;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
GError *mapi_error = NULL;
struct FetchContactsUidsData fcud = { 0 };
guint32 options;
@@ -1166,7 +1166,7 @@ ebbm_contacts_fetch_known_uids (EBookBackendMAPI *ebma, GCancellable *cancelled,
fcud.cancelled = cancelled;
fcud.uids = uids;
- exchange_mapi_connection_fetch_items (conn, priv->fid, NULL, NULL,
+ e_mapi_connection_fetch_items (conn, priv->fid, NULL, NULL,
mapi_book_utils_get_prop_list, GET_UIDS_ONLY,
fetch_contacts_uids_cb, &fcud, options, &mapi_error);
diff --git a/src/addressbook/e-book-backend-mapi-gal.c b/src/addressbook/e-book-backend-mapi-gal.c
index 990e6e0..3cc0834 100644
--- a/src/addressbook/e-book-backend-mapi-gal.c
+++ b/src/addressbook/e-book-backend-mapi-gal.c
@@ -39,16 +39,16 @@ get_uid_from_row (struct SRow *aRow, uint32_t row_index, mapi_id_t fid)
g_return_val_if_fail (aRow != NULL, NULL);
- str = exchange_mapi_util_find_row_propval (aRow, PR_EMAIL_ADDRESS_UNICODE);
+ str = e_mapi_util_find_row_propval (aRow, PR_EMAIL_ADDRESS_UNICODE);
if (str && *str)
suid = g_strdup (str);
if (!suid) {
const mapi_id_t *midptr;
- midptr = exchange_mapi_util_find_row_propval (aRow, PR_MID);
+ midptr = e_mapi_util_find_row_propval (aRow, PR_MID);
- suid = exchange_mapi_util_mapi_ids_to_uid (fid, midptr ? *midptr : row_index);
+ suid = e_mapi_util_mapi_ids_to_uid (fid, midptr ? *midptr : row_index);
}
return suid;
@@ -63,7 +63,7 @@ struct FetchGalData
};
static gboolean
-fetch_gal_cb (ExchangeMapiConnection *conn, uint32_t row_index, uint32_t n_rows, struct SRow *aRow, gpointer data)
+fetch_gal_cb (EMapiConnection *conn, uint32_t row_index, uint32_t n_rows, struct SRow *aRow, gpointer data)
{
struct FetchGalData *fgd = data;
struct timeval *last_modification = NULL, tv = { 0 };
@@ -110,7 +110,7 @@ struct FetchGalUidsData
};
static gboolean
-fetch_gal_uids_cb (ExchangeMapiConnection *conn, uint32_t row_index, uint32_t n_rows, struct SRow *aRow, gpointer data)
+fetch_gal_uids_cb (EMapiConnection *conn, uint32_t row_index, uint32_t n_rows, struct SRow *aRow, gpointer data)
{
gchar *uid;
struct FetchGalUidsData *fgud = data;
@@ -167,7 +167,7 @@ ebbm_gal_fetch_contacts (EBookBackendMAPI *ebma, struct mapi_SRestriction *restr
{
GError *mapi_error = NULL;
struct FetchGalData fgd = { 0 };
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
gchar *last_fetch;
gboolean fetch_successful;
@@ -201,9 +201,9 @@ ebbm_gal_fetch_contacts (EBookBackendMAPI *ebma, struct mapi_SRestriction *restr
fgd.ebma = ebma;
fgd.book_view = book_view;
fgd.notify_contact_data = notify_contact_data;
- fgd.fid = exchange_mapi_connection_get_default_folder_id (conn, olFolderContacts, NULL);
+ fgd.fid = e_mapi_connection_get_default_folder_id (conn, olFolderContacts, NULL);
- fetch_successful = exchange_mapi_connection_fetch_gal (conn, restriction,
+ fetch_successful = e_mapi_connection_fetch_gal (conn, restriction,
mapi_book_utils_get_prop_list, GET_ALL_KNOWN_IDS,
fetch_gal_cb, &fgd, &mapi_error);
@@ -230,7 +230,7 @@ ebbm_gal_fetch_contacts (EBookBackendMAPI *ebma, struct mapi_SRestriction *restr
static void
ebbm_gal_fetch_known_uids (EBookBackendMAPI *ebma, GCancellable *cancelled, GHashTable *uids, GError **error)
{
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
GError *mapi_error = NULL;
struct FetchGalUidsData fgud = { 0 };
@@ -249,9 +249,9 @@ ebbm_gal_fetch_known_uids (EBookBackendMAPI *ebma, GCancellable *cancelled, GHas
fgud.cancelled = cancelled;
fgud.uids = uids;
- fgud.fid = exchange_mapi_connection_get_default_folder_id (conn, olFolderContacts, NULL);
+ fgud.fid = e_mapi_connection_get_default_folder_id (conn, olFolderContacts, NULL);
- exchange_mapi_connection_fetch_gal (conn, NULL,
+ e_mapi_connection_fetch_gal (conn, NULL,
mapi_book_utils_get_prop_list, GET_UIDS_ONLY,
fetch_gal_uids_cb, &fgud, &mapi_error);
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index 563fefc..4d86d1e 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -36,10 +36,10 @@
#include <libedataserver/e-data-server-util.h>
#include <camel/camel.h>
-#include <em-operation-queue.h>
+#include <e-mapi-operation-queue.h>
-#include "exchange-mapi-utils.h"
-#include "exchange-mapi-defs.h"
+#include "e-mapi-utils.h"
+#include "e-mapi-defs.h"
#include "e-book-backend-mapi.h"
@@ -47,10 +47,10 @@ G_DEFINE_TYPE (EBookBackendMAPI, e_book_backend_mapi, E_TYPE_BOOK_BACKEND)
struct _EBookBackendMAPIPrivate
{
- EMOperationQueue *op_queue;
+ EMapiOperationQueue *op_queue;
GMutex *conn_lock;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
gchar *profile;
gchar *book_uri;
gboolean marked_for_offline;
@@ -172,7 +172,7 @@ ebbm_set_cache_time (EBookBackendMAPI *ebma, glong cache_seconds)
g_free (iso_time);
if (error) {
- exchange_mapi_debug_print ("%s: Failed to set value: %s", G_STRFUNC, error->message);
+ e_mapi_debug_print ("%s: Failed to set value: %s", G_STRFUNC, error->message);
g_error_free (error);
}
}
@@ -390,7 +390,7 @@ ebbm_connect_user (EBookBackendMAPI *ebma, GCancellable *cancellable, const gcha
{
EBookBackendMAPIPrivate *priv = ebma->priv;
GError *mapi_error = NULL;
- ExchangeMapiConnection *old_conn;
+ EMapiConnection *old_conn;
if (!e_backend_get_online (E_BACKEND (ebma))) {
ebbm_notify_connection_status (ebma, FALSE);
@@ -411,13 +411,13 @@ ebbm_connect_user (EBookBackendMAPI *ebma, GCancellable *cancellable, const gcha
old_conn = priv->conn;
priv->conn = NULL;
- priv->conn = exchange_mapi_connection_new (priv->profile,
+ priv->conn = e_mapi_connection_new (priv->profile,
password,
&mapi_error);
if (!priv->conn) {
- priv->conn = exchange_mapi_connection_find (priv->profile);
- if (priv->conn && !exchange_mapi_connection_connected (priv->conn))
- exchange_mapi_connection_reconnect (priv->conn, password, &mapi_error);
+ priv->conn = e_mapi_connection_find (priv->profile);
+ if (priv->conn && !e_mapi_connection_connected (priv->conn))
+ e_mapi_connection_reconnect (priv->conn, password, &mapi_error);
}
if (old_conn)
@@ -1092,7 +1092,7 @@ base_op_abstract (EBookBackend *backend, EDataBook *book, guint32 opid, GCancell
op->opid = opid;
op->cancellable = cancellable;
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -1122,7 +1122,7 @@ str_op_abstract (EBookBackend *backend, EDataBook *book, guint32 opid, GCancella
op->base.cancellable = cancellable;
op->str = g_strdup (str);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -1158,7 +1158,7 @@ str_slist_op_abstract (EBookBackend *backend, EDataBook *book, guint32 opid, GCa
l->data = g_strdup (l->data);
}
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
#define BASE_OP_DEF(_func, _ot) \
@@ -1217,7 +1217,7 @@ ebbm_op_open (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable
op->base.cancellable = cancellable;
op->only_if_exists = only_if_exists;
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -1245,7 +1245,7 @@ ebbm_op_start_book_view (EBookBackend *backend, EDataBookView *book_view)
g_hash_table_insert (priv->running_book_views, book_view, GINT_TO_POINTER(1));
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -1273,7 +1273,7 @@ ebbm_op_stop_book_view (EBookBackend *backend, EDataBookView *book_view)
g_hash_table_remove (priv->running_book_views, book_view);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -1302,7 +1302,7 @@ ebbm_op_authenticate_user (EBookBackend *backend, GCancellable *cancellable, ECr
op->base.cancellable = cancellable;
op->credentials = e_credentials_new_clone (credentials);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -1310,7 +1310,7 @@ e_book_backend_mapi_init (EBookBackendMAPI *ebma)
{
ebma->priv = G_TYPE_INSTANCE_GET_PRIVATE (ebma, E_TYPE_BOOK_BACKEND_MAPI, EBookBackendMAPIPrivate);
- ebma->priv->op_queue = em_operation_queue_new ((EMOperationQueueFunc) ebbm_operation_cb, ebma);
+ ebma->priv->op_queue = e_mapi_operation_queue_new ((EMapiOperationQueueFunc) ebbm_operation_cb, ebma);
ebma->priv->running_book_views = g_hash_table_new (g_direct_hash, g_direct_equal);
ebma->priv->conn_lock = g_mutex_new ();
@@ -1440,7 +1440,7 @@ e_book_backend_mapi_unlock_connection (EBookBackendMAPI *ebma)
g_mutex_unlock (ebma->priv->conn_lock);
}
-ExchangeMapiConnection *
+EMapiConnection *
e_book_backend_mapi_get_connection (EBookBackendMAPI *ebma)
{
g_return_val_if_fail (E_IS_BOOK_BACKEND_MAPI (ebma), NULL);
@@ -1645,7 +1645,7 @@ e_book_backend_mapi_cache_get (EBookBackendMAPI *ebma, const gchar *key)
/* 'data' is one of GET_ALL_KNOWN_IDS or GET_UIDS_ONLY */
gboolean
-mapi_book_utils_get_prop_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
+mapi_book_utils_get_prop_list (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
{
/* this is a list of all known book MAPI tag IDs;
if you add new add it here too, otherwise it may not be fetched */
@@ -1726,16 +1726,16 @@ mapi_book_utils_get_prop_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALL
g_return_val_if_fail (props != NULL, FALSE);
if (data == GET_UIDS_ONLY)
- return exchange_mapi_utils_add_props_to_props_array (mem_ctx, props, uids_only_ids, G_N_ELEMENTS (uids_only_ids));
+ return e_mapi_utils_add_props_to_props_array (mem_ctx, props, uids_only_ids, G_N_ELEMENTS (uids_only_ids));
- if (data == GET_ALL_KNOWN_IDS && !exchange_mapi_utils_add_props_to_props_array (mem_ctx, props, known_book_mapi_ids, G_N_ELEMENTS (known_book_mapi_ids)))
+ if (data == GET_ALL_KNOWN_IDS && !e_mapi_utils_add_props_to_props_array (mem_ctx, props, known_book_mapi_ids, G_N_ELEMENTS (known_book_mapi_ids)))
return FALSE;
/* called with fid = 0 from GAL */
if (!fid)
- fid = exchange_mapi_connection_get_default_folder_id (conn, olFolderContacts, NULL);
+ fid = e_mapi_connection_get_default_folder_id (conn, olFolderContacts, NULL);
- return exchange_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
+ return e_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
}
static gchar *
@@ -1763,7 +1763,7 @@ not_null (gconstpointer ptr)
/* This is not setting E_CONTACT_UID */
EContact *
-mapi_book_utils_contact_from_props (ExchangeMapiConnection *conn, mapi_id_t fid, const gchar *book_uri, struct mapi_SPropValue_array *mapi_properties, struct SRow *aRow)
+mapi_book_utils_contact_from_props (EMapiConnection *conn, mapi_id_t fid, const gchar *book_uri, struct mapi_SPropValue_array *mapi_properties, struct SRow *aRow)
{
EContact *contact = e_contact_new ();
gint i;
@@ -1771,9 +1771,9 @@ mapi_book_utils_contact_from_props (ExchangeMapiConnection *conn, mapi_id_t fid,
if (book_uri)
e_contact_set (contact, E_CONTACT_BOOK_URI, book_uri);
- #define get_proptag(proptag) (aRow ? exchange_mapi_util_find_row_propval (aRow, proptag) : exchange_mapi_util_find_array_propval (mapi_properties, proptag))
+ #define get_proptag(proptag) (aRow ? e_mapi_util_find_row_propval (aRow, proptag) : e_mapi_util_find_array_propval (mapi_properties, proptag))
#define get_str_proptag(proptag) not_null (get_proptag (proptag))
- #define get_namedid(nid) (aRow ? exchange_mapi_util_find_row_namedid (aRow, conn, fid, nid) : exchange_mapi_util_find_array_namedid (mapi_properties, conn, fid, nid))
+ #define get_namedid(nid) (aRow ? e_mapi_util_find_row_namedid (aRow, conn, fid, nid) : e_mapi_util_find_array_namedid (mapi_properties, conn, fid, nid))
#define get_str_namedid(nid) not_null (get_namedid (nid))
if (g_str_equal (get_str_proptag (PR_MESSAGE_CLASS), IPM_DISTLIST)) {
@@ -1804,7 +1804,7 @@ mapi_book_utils_contact_from_props (ExchangeMapiConnection *conn, mapi_id_t fid,
br.lpb = members->bin[i].lpb;
br.cb = members->bin[i].cb;
- if (exchange_mapi_util_recip_entryid_decode (conn, &br, &display_name, &email)) {
+ if (e_mapi_util_recip_entryid_decode (conn, &br, &display_name, &email)) {
EVCardAttribute *attr;
gchar *value;
CamelInternetAddress *addr;
@@ -1874,7 +1874,7 @@ mapi_book_utils_contact_from_props (ExchangeMapiConnection *conn, mapi_id_t fid,
gchar *buff = NULL;
GTimeVal tv;
- tv.tv_sec = exchange_mapi_util_filetime_to_time_t (t);
+ tv.tv_sec = e_mapi_util_filetime_to_time_t (t);
tv.tv_usec = 0;
buff = g_time_val_to_iso8601 (&tv);
@@ -1902,7 +1902,7 @@ mapi_book_utils_contact_from_props (ExchangeMapiConnection *conn, mapi_id_t fid,
if (value) {
EContactDate date = {0};
- time = exchange_mapi_util_filetime_to_time_t (t);
+ time = e_mapi_util_filetime_to_time_t (t);
tmtime = gmtime (&time);
date.day = tmtime->tm_mday;
diff --git a/src/addressbook/e-book-backend-mapi.h b/src/addressbook/e-book-backend-mapi.h
index 3ecb34d..fa2249c 100644
--- a/src/addressbook/e-book-backend-mapi.h
+++ b/src/addressbook/e-book-backend-mapi.h
@@ -29,9 +29,9 @@
#include <libedata-book/e-data-book-view.h>
#include <libedata-book/e-book-backend-sqlitedb.h>
-#include "exchange-mapi-connection.h"
-#include "exchange-mapi-defs.h"
-#include "exchange-mapi-utils.h"
+#include "e-mapi-connection.h"
+#include "e-mapi-defs.h"
+#include "e-mapi-utils.h"
G_BEGIN_DECLS
@@ -93,7 +93,7 @@ gboolean e_book_backend_mapi_debug_enabled (void);
const gchar *e_book_backend_mapi_get_book_uri (EBookBackendMAPI *ebma);
void e_book_backend_mapi_lock_connection (EBookBackendMAPI *ebma);
void e_book_backend_mapi_unlock_connection (EBookBackendMAPI *ebma);
-ExchangeMapiConnection *e_book_backend_mapi_get_connection (EBookBackendMAPI *ebma);
+EMapiConnection *e_book_backend_mapi_get_connection (EBookBackendMAPI *ebma);
void e_book_backend_mapi_get_db (EBookBackendMAPI *ebma, EBookBackendSqliteDB **db);
gboolean e_book_backend_mapi_book_view_is_running (EBookBackendMAPI *ebma, EDataBookView *book_view);
void e_book_backend_mapi_update_view_by_cache (EBookBackendMAPI *ebma, EDataBookView *book_view, GError **error);
@@ -124,10 +124,10 @@ void mapi_error_to_edb_error (GError **perror, const GError *mapi_error, EDataBo
#define GET_UIDS_ONLY (GINT_TO_POINTER(2))
/* data is one of GET_ALL_KNOWN_IDS or GET_UIDS_ONLY */
-gboolean mapi_book_utils_get_prop_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data);
+gboolean mapi_book_utils_get_prop_list (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data);
/* only one of mapi_properties and aRow can be set */
-EContact *mapi_book_utils_contact_from_props (ExchangeMapiConnection *conn, mapi_id_t fid, const gchar *book_uri, struct mapi_SPropValue_array *mapi_properties, struct SRow *aRow);
+EContact *mapi_book_utils_contact_from_props (EMapiConnection *conn, mapi_id_t fid, const gchar *book_uri, struct mapi_SPropValue_array *mapi_properties, struct SRow *aRow);
G_END_DECLS
diff --git a/src/calendar/e-cal-backend-mapi.c b/src/calendar/e-cal-backend-mapi.c
index 54f8e03..545aedf 100644
--- a/src/calendar/e-cal-backend-mapi.c
+++ b/src/calendar/e-cal-backend-mapi.c
@@ -33,10 +33,10 @@
#include <libedata-cal/e-cal-backend-file-store.h>
#include <libedataserver/e-xml-hash-utils.h>
-#include <exchange-mapi-connection.h>
-#include <exchange-mapi-cal-utils.h>
-#include <exchange-mapi-utils.h>
-#include <em-operation-queue.h>
+#include <e-mapi-connection.h>
+#include <e-mapi-cal-utils.h>
+#include <e-mapi-utils.h>
+#include <e-mapi-operation-queue.h>
#include "e-cal-backend-mapi.h"
@@ -68,12 +68,12 @@ typedef struct {
/* Private part of the CalBackendMAPI structure */
struct _ECalBackendMAPIPrivate {
- EMOperationQueue *op_queue;
+ EMapiOperationQueue *op_queue;
mapi_id_t fid;
uint32_t olFolder;
gchar *profile;
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
/* These fields are entirely for access rights */
gchar *owner_name;
@@ -266,14 +266,14 @@ ecbm_remove (ECalBackend *backend, EDataCal *cal, GCancellable *cancellable, GEr
source = e_backend_get_source (E_BACKEND (cbmapi));
- if (!e_backend_get_online (E_BACKEND (backend)) || !priv->conn || !exchange_mapi_connection_connected (priv->conn)) {
+ if (!e_backend_get_online (E_BACKEND (backend)) || !priv->conn || !e_mapi_connection_connected (priv->conn)) {
g_propagate_error (perror, EDC_ERROR (RepositoryOffline));
return;
}
if (g_strcmp0 (e_source_get_property (source, "public"), "yes") != 0) {
GError *mapi_error = NULL;
- if (!exchange_mapi_connection_remove_folder (priv->conn, priv->fid, 0, &mapi_error)) {
+ if (!e_mapi_connection_remove_folder (priv->conn, priv->fid, 0, &mapi_error)) {
mapi_error_to_edc_error (perror, mapi_error, OtherError, _("Failed to remove public folder"));
if (mapi_error)
g_error_free (mapi_error);
@@ -416,20 +416,20 @@ mapi_cal_get_changes_cb (FetchItemsCallbackData *item_data, gpointer data)
kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
cache_dir = e_cal_backend_get_cache_dir (E_CAL_BACKEND (cbmapi));
- recurring = exchange_mapi_util_find_array_namedid (array, item_data->conn, item_data->fid, PidLidTaskFRecurring);
+ recurring = e_mapi_util_find_array_namedid (array, item_data->conn, item_data->fid, PidLidTaskFRecurring);
if (recurring && *recurring) {
g_warning ("Encountered a recurring task.");
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_attachment_list (&attachments);
return TRUE;
}
- tmp = exchange_mapi_util_mapi_id_to_string (mid);
+ tmp = e_mapi_util_mapi_id_to_string (mid);
cache_comp = e_cal_backend_store_get_component (priv->store, tmp, NULL);
if (cache_comp == NULL) {
- ECalComponent *comp = exchange_mapi_cal_util_mapi_props_to_comp (item_data->conn, item_data->fid, kind, tmp, array,
+ ECalComponent *comp = e_mapi_cal_util_mapi_props_to_comp (item_data->conn, item_data->fid, kind, tmp, array,
streams, recipients, attachments,
cache_dir, icaltimezone_get_utc_timezone (), FALSE, &detached);
@@ -469,7 +469,7 @@ mapi_cal_get_changes_cb (FetchItemsCallbackData *item_data, gpointer data)
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 (item_data->conn, item_data->fid, kind, tmp, array,
+ comp = e_mapi_cal_util_mapi_props_to_comp (item_data->conn, item_data->fid, kind, tmp, array,
streams, recipients, attachments,
cache_dir, icaltimezone_get_utc_timezone (), FALSE, NULL);
@@ -489,9 +489,9 @@ mapi_cal_get_changes_cb (FetchItemsCallbackData *item_data, gpointer data)
}
g_free (tmp);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_attachment_list (&attachments);
notify_view_progress (cbmapi, item_data->index, item_data->total);
@@ -525,7 +525,7 @@ handle_deleted_items_cb (FetchItemsCallbackData *item_data, gpointer data)
g_return_val_if_fail (did != NULL, FALSE);
- tmp = exchange_mapi_util_mapi_id_to_string (mid);
+ tmp = e_mapi_util_mapi_id_to_string (mid);
cache_comp_uid = g_slist_find_custom (did->cache_ids, tmp, (GCompareFunc) (g_ascii_strcasecmp));
if (cache_comp_uid != NULL) {
ECalBackendMAPIPrivate *priv = did->cbmapi->priv;
@@ -569,7 +569,7 @@ handle_deleted_items_cb (FetchItemsCallbackData *item_data, gpointer data)
}
static gboolean
-mapi_cal_get_idlist (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
+mapi_cal_get_idlist (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
{
static const uint32_t cal_IDList[] = {
PR_FID,
@@ -579,7 +579,7 @@ mapi_cal_get_idlist (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *me
g_return_val_if_fail (props != NULL, FALSE);
- return exchange_mapi_utils_add_props_to_props_array (mem_ctx, props, cal_IDList, G_N_ELEMENTS (cal_IDList));
+ return e_mapi_utils_add_props_to_props_array (mem_ctx, props, cal_IDList, G_N_ELEMENTS (cal_IDList));
}
/* Simple workflow for fetching deltas:
@@ -655,8 +655,8 @@ get_deltas (gpointer handle)
use_restriction = FALSE;
}
- if (!exchange_mapi_connection_fetch_items (priv->conn, priv->fid, use_restriction ? &res : NULL, NULL,
- is_public ? NULL : exchange_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (kind),
+ if (!e_mapi_connection_fetch_items (priv->conn, priv->fid, use_restriction ? &res : NULL, NULL,
+ is_public ? NULL : e_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (kind),
mapi_cal_get_changes_cb, cbmapi,
options, &mapi_error)) {
if (mapi_error) {
@@ -699,7 +699,7 @@ get_deltas (gpointer handle)
if (g_strcmp0 (e_source_get_property (source, "public"), "yes") == 0)
options = MAPI_OPTIONS_USE_PFSTORE;
- if (!exchange_mapi_connection_fetch_items (priv->conn, priv->fid, NULL, NULL,
+ if (!e_mapi_connection_fetch_items (priv->conn, priv->fid, NULL, NULL,
mapi_cal_get_idlist, NULL,
handle_deleted_items_cb, &did,
options, &mapi_error)) {
@@ -776,8 +776,8 @@ get_deltas (gpointer handle)
is_public = TRUE;
}
- if (!exchange_mapi_connection_fetch_items (priv->conn, priv->fid, &res, NULL,
- is_public ? NULL : exchange_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (kind),
+ if (!e_mapi_connection_fetch_items (priv->conn, priv->fid, &res, NULL,
+ is_public ? NULL : e_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (kind),
mapi_cal_get_changes_cb, cbmapi,
options, &mapi_error)) {
if (mapi_error) {
@@ -1026,17 +1026,17 @@ mapi_cal_cache_create_cb (FetchItemsCallbackData *item_data, gpointer data)
kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
cache_dir = e_cal_backend_get_cache_dir (E_CAL_BACKEND (cbmapi));
-// exchange_mapi_debug_property_dump (properties);
+// e_mapi_debug_property_dump (properties);
switch (kind) {
case ICAL_VTODO_COMPONENT:
/* FIXME: Evolution does not support recurring tasks */
- recurring = exchange_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidTaskFRecurring);
+ recurring = e_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidTaskFRecurring);
if (recurring && *recurring) {
g_warning ("Encountered a recurring task.");
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_attachment_list (&attachments);
return TRUE;
}
break;
@@ -1047,8 +1047,8 @@ mapi_cal_cache_create_cb (FetchItemsCallbackData *item_data, gpointer data)
return FALSE;
}
- tmp = exchange_mapi_util_mapi_id_to_string (mid);
- comp = exchange_mapi_cal_util_mapi_props_to_comp (item_data->conn, item_data->fid, kind, tmp, properties,
+ tmp = e_mapi_util_mapi_id_to_string (mid);
+ comp = e_mapi_cal_util_mapi_props_to_comp (item_data->conn, item_data->fid, kind, tmp, properties,
streams, recipients, attachments,
cache_dir, icaltimezone_get_utc_timezone (), FALSE, &detached);
g_free (tmp);
@@ -1072,9 +1072,9 @@ mapi_cal_cache_create_cb (FetchItemsCallbackData *item_data, gpointer data)
}
g_slist_free (detached);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_attachment_list (&attachments);
notify_view_progress (cbmapi, item_data->index, item_data->total);
@@ -1119,8 +1119,8 @@ populate_cache (ECalBackendMAPI *cbmapi, GError **perror)
is_public = TRUE;
}
- if (!exchange_mapi_connection_fetch_items (priv->conn, priv->fid, NULL, NULL,
- is_public ? NULL : exchange_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (kind),
+ if (!e_mapi_connection_fetch_items (priv->conn, priv->fid, NULL, NULL,
+ is_public ? NULL : e_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (kind),
mapi_cal_cache_create_cb, cbmapi,
options, &mapi_error)) {
e_cal_backend_store_thaw_changes (priv->store);
@@ -1191,7 +1191,7 @@ ecbm_connect (ECalBackendMAPI *cbmapi, GError **perror)
return;
}
- if (!priv->conn || !exchange_mapi_connection_connected (priv->conn)) {
+ if (!priv->conn || !e_mapi_connection_connected (priv->conn)) {
g_propagate_error (perror, EDC_ERROR (AuthenticationFailed));
return;
}
@@ -1225,7 +1225,7 @@ ecbm_connect_user (ECalBackend *backend, GCancellable *cancellable, const gchar
{
ECalBackendMAPI *cbmapi;
ECalBackendMAPIPrivate *priv;
- ExchangeMapiConnection *old_conn;
+ EMapiConnection *old_conn;
GError *mapi_error = NULL;
g_static_mutex_lock (&auth_mutex);
@@ -1235,19 +1235,19 @@ ecbm_connect_user (ECalBackend *backend, GCancellable *cancellable, const gchar
old_conn = priv->conn;
- priv->conn = exchange_mapi_connection_new (priv->profile, password, &mapi_error);
+ priv->conn = e_mapi_connection_new (priv->profile, password, &mapi_error);
if (!priv->conn) {
- priv->conn = exchange_mapi_connection_find (priv->profile);
+ priv->conn = e_mapi_connection_find (priv->profile);
if (priv->conn
- && !exchange_mapi_connection_connected (priv->conn)) {
- exchange_mapi_connection_reconnect (priv->conn, password, &mapi_error);
+ && !e_mapi_connection_connected (priv->conn)) {
+ e_mapi_connection_reconnect (priv->conn, password, &mapi_error);
}
}
if (old_conn)
g_object_unref (old_conn);
- if (priv->conn && exchange_mapi_connection_connected (priv->conn)) {
+ if (priv->conn && e_mapi_connection_connected (priv->conn)) {
/* Success */;
} else {
mapi_error_to_edc_error (perror, mapi_error, AuthenticationFailed, NULL);
@@ -1359,7 +1359,7 @@ ecbm_open (ECalBackend *backend, EDataCal *cal, GCancellable *cancellable, gbool
priv->owner_name = g_strdup (e_source_get_property (esource, "acl-owner-name"));
priv->owner_email = g_strdup (e_source_get_property (esource, "acl-owner-email"));
- exchange_mapi_util_mapi_id_from_string (fid, &priv->fid);
+ e_mapi_util_mapi_id_from_string (fid, &priv->fid);
priv->olFolder = olFolder;
krb_sso = e_source_get_property (esource, "kerberos");
@@ -1388,7 +1388,7 @@ ecbm_authenticate_user (ECalBackend *backend, GCancellable *cancellable, ECreden
}
static gboolean
-mapi_cal_get_required_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
+mapi_cal_get_required_props (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
{
static uint32_t req_props_list[] = {
PR_OWNER_APPT_ID,
@@ -1409,10 +1409,10 @@ mapi_cal_get_required_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC
g_return_val_if_fail (props != NULL, FALSE);
- if (!exchange_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids)))
+ if (!e_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids)))
return FALSE;
- return exchange_mapi_utils_add_props_to_props_array (mem_ctx, props, req_props_list, G_N_ELEMENTS (req_props_list));
+ return e_mapi_utils_add_props_to_props_array (mem_ctx, props, req_props_list, G_N_ELEMENTS (req_props_list));
}
static gboolean
@@ -1425,17 +1425,17 @@ capture_req_props (FetchItemsCallbackData *item_data, gpointer data)
ui32 = (const uint32_t *)find_mapi_SPropValue_data(properties, PR_OWNER_APPT_ID);
if (ui32)
cbdata->appt_id = *ui32;
- ui32 = exchange_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidAppointmentSequence);
+ ui32 = e_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidAppointmentSequence);
if (ui32)
cbdata->appt_seq = *ui32;
- cbdata->cleanglobalid = exchange_mapi_util_copy_binary_r (exchange_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidCleanGlobalObjectId));
- cbdata->globalid = exchange_mapi_util_copy_binary_r (exchange_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidGlobalObjectId));
- cbdata->username = g_strdup (exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME_UNICODE));
- cbdata->useridtype = g_strdup (exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE_UNICODE));
- cbdata->userid = g_strdup (exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE));
- cbdata->ownername = g_strdup (exchange_mapi_util_find_array_propval (properties, PR_SENDER_NAME_UNICODE));
- cbdata->owneridtype = g_strdup (exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE_UNICODE));
- cbdata->ownerid = g_strdup (exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS_UNICODE));
+ cbdata->cleanglobalid = e_mapi_util_copy_binary_r (e_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidCleanGlobalObjectId));
+ cbdata->globalid = e_mapi_util_copy_binary_r (e_mapi_util_find_array_namedid (properties, item_data->conn, item_data->fid, PidLidGlobalObjectId));
+ cbdata->username = g_strdup (e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME_UNICODE));
+ cbdata->useridtype = g_strdup (e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE_UNICODE));
+ cbdata->userid = g_strdup (e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE));
+ cbdata->ownername = g_strdup (e_mapi_util_find_array_propval (properties, PR_SENDER_NAME_UNICODE));
+ cbdata->owneridtype = g_strdup (e_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE_UNICODE));
+ cbdata->ownerid = g_strdup (e_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS_UNICODE));
return TRUE;
}
@@ -1448,12 +1448,12 @@ get_comp_mid (icalcomponent *icalcomp, mapi_id_t *mid)
g_return_if_fail (icalcomp != NULL);
g_return_if_fail (mid != NULL);
- x_mid = exchange_mapi_cal_utils_get_icomp_x_prop (icalcomp, "X-EVOLUTION-MAPI-MID");
+ x_mid = e_mapi_cal_utils_get_icomp_x_prop (icalcomp, "X-EVOLUTION-MAPI-MID");
if (x_mid) {
- exchange_mapi_util_mapi_id_from_string (x_mid, mid);
+ e_mapi_util_mapi_id_from_string (x_mid, mid);
g_free (x_mid);
} else {
- exchange_mapi_util_mapi_id_from_string (icalcomponent_get_uid (icalcomp), mid);
+ e_mapi_util_mapi_id_from_string (icalcomponent_get_uid (icalcomp), mid);
}
}
@@ -1475,21 +1475,21 @@ get_server_data (ECalBackendMAPI *cbmapi, ECalComponent *comp, struct cal_cbdata
icalcomp = e_cal_component_get_icalcomponent (comp);
uid = icalcomponent_get_uid (icalcomp);
get_comp_mid (icalcomp, &mid);
- if (exchange_mapi_connection_fetch_item (priv->conn, priv->fid, mid,
+ if (e_mapi_connection_fetch_item (priv->conn, priv->fid, mid,
mapi_cal_get_required_props, NULL,
capture_req_props, cbdata,
MAPI_OPTIONS_FETCH_GENERIC_STREAMS, NULL))
return;
- proptag = exchange_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidCleanGlobalObjectId, NULL);
+ proptag = e_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidCleanGlobalObjectId, NULL);
if (proptag == MAPI_E_RESERVED) proptag = PidLidCleanGlobalObjectId;
res.rt = RES_PROPERTY;
res.res.resProperty.relop = RELOP_EQ;
res.res.resProperty.ulPropTag = proptag;
- propval = exchange_mapi_cal_utils_get_icomp_x_prop (icalcomp, "X-EVOLUTION-MAPI-GLOBALID");
+ propval = e_mapi_cal_utils_get_icomp_x_prop (icalcomp, "X-EVOLUTION-MAPI-GLOBALID");
if (propval && *propval) {
gsize len = 0;
@@ -1501,8 +1501,8 @@ get_server_data (ECalBackendMAPI *cbmapi, ECalComponent *comp, struct cal_cbdata
e_cal_component_get_dtstamp (comp, &ical_creation_time);
- exchange_mapi_util_time_t_to_filetime (icaltime_as_timet (ical_creation_time), &creation_time);
- exchange_mapi_cal_util_generate_globalobjectid (TRUE, uid, NULL, ical_creation_time.year ? &creation_time : NULL, &sb);
+ e_mapi_util_time_t_to_filetime (icaltime_as_timet (ical_creation_time), &creation_time);
+ e_mapi_cal_util_generate_globalobjectid (TRUE, uid, NULL, ical_creation_time.year ? &creation_time : NULL, &sb);
}
g_free (propval);
@@ -1510,7 +1510,7 @@ get_server_data (ECalBackendMAPI *cbmapi, ECalComponent *comp, struct cal_cbdata
set_SPropValue_proptag (&sprop, proptag, (gconstpointer ) &sb);
cast_mapi_SPropValue (mem_ctx, &(res.res.resProperty.lpProp), &sprop);
- exchange_mapi_connection_fetch_items (priv->conn, priv->fid, &res, NULL,
+ e_mapi_connection_fetch_items (priv->conn, priv->fid, &res, NULL,
mapi_cal_get_required_props, NULL,
capture_req_props, cbdata,
MAPI_OPTIONS_FETCH_GENERIC_STREAMS, NULL);
@@ -1527,8 +1527,8 @@ free_server_data (struct cal_cbdata *cbdata)
#define do_free(_func, _val) _func (_val); _val = NULL
- do_free (exchange_mapi_util_free_binary_r, cbdata->cleanglobalid);
- do_free (exchange_mapi_util_free_binary_r, cbdata->globalid);
+ do_free (e_mapi_util_free_binary_r, cbdata->cleanglobalid);
+ do_free (e_mapi_util_free_binary_r, cbdata->globalid);
do_free (g_free, cbdata->username);
do_free (g_free, cbdata->useridtype);
do_free (g_free, cbdata->userid);
@@ -1601,11 +1601,11 @@ ecbm_create_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
/* 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 = e_mapi_cal_util_rrule_to_bin (comp, NULL);
if (ba) {
ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1);
stream->value = ba;
- stream->proptag = exchange_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidAppointmentRecur, NULL);
+ stream->proptag = e_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidAppointmentRecur, NULL);
if (stream->proptag != MAPI_E_RESERVED)
streams = g_slist_append (streams, stream);
}
@@ -1613,10 +1613,10 @@ ecbm_create_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
/* FIXME: [WIP] Add support for meetings/assigned tasks */
if (e_cal_component_has_attendees (comp))
- exchange_mapi_cal_util_fetch_recipients (comp, &recipients);
+ e_mapi_cal_util_fetch_recipients (comp, &recipients);
if (e_cal_component_has_attachments (comp))
- exchange_mapi_cal_util_fetch_attachments (comp, &attachments, cache_dir);
+ e_mapi_cal_util_fetch_attachments (comp, &attachments, cache_dir);
cbdata.kind = kind;
cbdata.username = (gchar *) ecbm_get_user_name (cbmapi);
@@ -1636,27 +1636,27 @@ ecbm_create_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
cbdata.msgflags = MSGFLAG_READ;
cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT : NOT_A_MEETING;
cbdata.resp = (recipients != NULL) ? olResponseOrganized : olResponseNone;
- cbdata.appt_id = exchange_mapi_cal_util_get_new_appt_id (priv->conn, priv->fid);
+ cbdata.appt_id = e_mapi_cal_util_get_new_appt_id (priv->conn, priv->fid);
cbdata.appt_seq = 0;
cbdata.globalid = NULL;
cbdata.cleanglobalid = NULL;
- mid = exchange_mapi_connection_create_item (priv->conn, priv->olFolder, priv->fid,
- exchange_mapi_cal_utils_write_props_cb, &cbdata,
+ mid = e_mapi_connection_create_item (priv->conn, priv->olFolder, priv->fid,
+ e_mapi_cal_utils_write_props_cb, &cbdata,
recipients, attachments, streams, MAPI_OPTIONS_DONT_SUBMIT, &mapi_error);
g_free (cbdata.props);
if (!mid) {
g_object_unref (comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_attachment_list (&attachments);
mapi_error_to_edc_error (error, mapi_error, OtherError, _("Failed to create item on a server"));
if (mapi_error)
g_error_free (mapi_error);
return;
}
- tmp = exchange_mapi_util_mapi_id_to_string (mid);
+ tmp = e_mapi_util_mapi_id_to_string (mid);
e_cal_component_set_uid (comp, tmp);
if (uid)
*uid = tmp;
@@ -1668,9 +1668,9 @@ ecbm_create_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
*new_icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
e_cal_backend_notify_component_created (E_CAL_BACKEND (cbmapi), *new_icalcomp);
} else {
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_attachment_list (&attachments);
g_propagate_error (error, EDC_ERROR (UnsupportedMethod));
return;
}
@@ -1679,9 +1679,9 @@ ecbm_create_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
g_cond_signal (priv->dlock->cond);
g_object_unref (comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_attachment_list (&attachments);
}
static gboolean
@@ -1804,21 +1804,21 @@ ecbm_modify_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
/* 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 = e_mapi_cal_util_rrule_to_bin (comp, NULL);
if (ba) {
ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1);
stream->value = ba;
- stream->proptag = exchange_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidAppointmentRecur, NULL);
+ stream->proptag = e_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidAppointmentRecur, NULL);
if (stream->proptag != MAPI_E_RESERVED)
streams = g_slist_append (streams, stream);
}
}
if (e_cal_component_has_attendees (comp))
- exchange_mapi_cal_util_fetch_recipients (comp, &recipients);
+ e_mapi_cal_util_fetch_recipients (comp, &recipients);
if (e_cal_component_has_attachments (comp))
- exchange_mapi_cal_util_fetch_attachments (comp, &attachments, cache_dir);
+ e_mapi_cal_util_fetch_attachments (comp, &attachments, cache_dir);
e_cal_component_get_uid (comp, &uid);
// rid = e_cal_component_get_recurid_as_string (comp);
@@ -1839,9 +1839,9 @@ ecbm_modify_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
if (!cache_comp) {
g_message ("CRITICAL : Could not find the object in cache");
g_object_unref (comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_attachment_list (&attachments);
g_propagate_error (error, EDC_ERROR (ObjectNotFound));
return;
}
@@ -1869,17 +1869,17 @@ ecbm_modify_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT_RCVD : NOT_A_MEETING;
}
- status = exchange_mapi_connection_modify_item (priv->conn, priv->olFolder, priv->fid, mid,
- exchange_mapi_cal_utils_write_props_cb, &cbdata,
+ status = e_mapi_connection_modify_item (priv->conn, priv->olFolder, priv->fid, mid,
+ e_mapi_cal_utils_write_props_cb, &cbdata,
recipients, attachments, streams, MAPI_OPTIONS_DONT_SUBMIT, &mapi_error);
g_free (cbdata.props);
free_server_data (&cbdata);
if (!status) {
g_object_unref (comp);
g_object_unref (cache_comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_attachment_list (&attachments);
mapi_error_to_edc_error (error, mapi_error, OtherError, _("Failed to modify item on a server"));
if (mapi_error)
@@ -1889,9 +1889,9 @@ ecbm_modify_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
} else {
g_object_unref (comp);
g_object_unref (cache_comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_attachment_list (&attachments);
g_propagate_error (error, EDC_ERROR (UnsupportedMethod));
return;
}
@@ -1904,9 +1904,9 @@ ecbm_modify_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
g_object_unref (comp);
g_object_unref (cache_comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_stream_list (&streams);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_stream_list (&streams);
+ e_mapi_util_free_attachment_list (&attachments);
}
static void
@@ -1972,7 +1972,7 @@ ecbm_remove_object (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
list = g_slist_prepend (list, (gpointer) data);
/* } */
- if (exchange_mapi_connection_remove_items (priv->conn, priv->olFolder, priv->fid, 0, list, &ri_error)) {
+ if (e_mapi_connection_remove_items (priv->conn, priv->olFolder, priv->fid, 0, list, &ri_error)) {
for (l = comp_list; l; l = l->next) {
ECalComponent *comp = E_CAL_COMPONENT (l->data);
ECalComponentId *id = e_cal_component_get_id (comp);
@@ -2060,18 +2060,18 @@ ecbm_send_objects (ECalBackend *backend, EDataCal *cal, GCancellable *cancellabl
/* 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 = e_mapi_cal_util_rrule_to_bin (comp, NULL);
if (ba) {
ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1);
stream->value = ba;
- stream->proptag = exchange_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidAppointmentRecur, NULL);
+ stream->proptag = e_mapi_connection_resolve_named_prop (priv->conn, priv->fid, PidLidAppointmentRecur, NULL);
if (stream->proptag != MAPI_E_RESERVED)
streams = g_slist_append (streams, stream);
}
}
if (e_cal_component_has_attachments (comp))
- exchange_mapi_cal_util_fetch_attachments (comp, &attachments, cache_dir);
+ e_mapi_cal_util_fetch_attachments (comp, &attachments, cache_dir);
cbdata.kind = kind;
cbdata.comp = comp;
@@ -2083,26 +2083,26 @@ ecbm_send_objects (ECalBackend *backend, EDataCal *cal, GCancellable *cancellabl
cbdata.meeting_type = MEETING_REQUEST;
cbdata.resp = olResponseNotResponded;
if (e_cal_component_has_attendees (comp))
- exchange_mapi_cal_util_fetch_recipients (comp, &recipients);
+ e_mapi_cal_util_fetch_recipients (comp, &recipients);
break;
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);
+ e_mapi_cal_util_fetch_recipients (comp, &recipients);
break;
case ICAL_METHOD_REPLY:
case ICAL_METHOD_RESPONSE :
cbdata.meeting_type = MEETING_RESPONSE;
cbdata.resp = find_my_response (cbmapi, comp);
if (e_cal_component_has_organizer (comp))
- exchange_mapi_cal_util_fetch_organizer (comp, &recipients);
+ e_mapi_cal_util_fetch_organizer (comp, &recipients);
break;
default :
cbdata.meeting_type = NOT_A_MEETING;
cbdata.resp = olResponseNone;
if (e_cal_component_has_attendees (comp))
- exchange_mapi_cal_util_fetch_organizer (comp, &recipients);
+ e_mapi_cal_util_fetch_organizer (comp, &recipients);
break;
}
@@ -2119,13 +2119,13 @@ ecbm_send_objects (ECalBackend *backend, EDataCal *cal, GCancellable *cancellabl
e_cal_component_get_uid (comp, &compuid);
e_cal_component_get_dtstamp (comp, &ical_creation_time);
- exchange_mapi_util_time_t_to_filetime (icaltime_as_timet (ical_creation_time), &creation_time);
+ e_mapi_util_time_t_to_filetime (icaltime_as_timet (ical_creation_time), &creation_time);
- propval = exchange_mapi_cal_utils_get_icomp_x_prop (e_cal_component_get_icalcomponent (comp), "X-EVOLUTION-MAPI-EXREPTIME");
+ propval = e_mapi_cal_utils_get_icomp_x_prop (e_cal_component_get_icalcomponent (comp), "X-EVOLUTION-MAPI-EXREPTIME");
if (propval && *propval) {
mapi_id_t val64 = 0;
- if (exchange_mapi_util_mapi_id_from_string (propval, &val64)) {
+ if (e_mapi_util_mapi_id_from_string (propval, &val64)) {
memcpy (&ex_rep_time, &val64, 8);
exception_repleace_time = &ex_rep_time;
}
@@ -2134,7 +2134,7 @@ ecbm_send_objects (ECalBackend *backend, EDataCal *cal, GCancellable *cancellabl
/* inherit GlobalID from the source object, if available */
if (e_cal_component_get_icalcomponent (comp)) {
- propval = exchange_mapi_cal_utils_get_icomp_x_prop (e_cal_component_get_icalcomponent (comp), "X-EVOLUTION-MAPI-GLOBALID");
+ propval = e_mapi_cal_utils_get_icomp_x_prop (e_cal_component_get_icalcomponent (comp), "X-EVOLUTION-MAPI-GLOBALID");
if (propval && *propval) {
gsize len = 0;
@@ -2159,19 +2159,19 @@ ecbm_send_objects (ECalBackend *backend, EDataCal *cal, GCancellable *cancellabl
}
if (compuid) {
- exchange_mapi_cal_util_generate_globalobjectid (FALSE, compuid, exception_repleace_time, ical_creation_time.year ? &creation_time : NULL, &globalid);
- exchange_mapi_cal_util_generate_globalobjectid (TRUE, compuid, exception_repleace_time, ical_creation_time.year ? &creation_time : NULL, &cleanglobalid);
+ e_mapi_cal_util_generate_globalobjectid (FALSE, compuid, exception_repleace_time, ical_creation_time.year ? &creation_time : NULL, &globalid);
+ e_mapi_cal_util_generate_globalobjectid (TRUE, compuid, exception_repleace_time, ical_creation_time.year ? &creation_time : NULL, &cleanglobalid);
}
if (cbdata.globalid)
- exchange_mapi_util_free_binary_r (cbdata.globalid);
+ e_mapi_util_free_binary_r (cbdata.globalid);
if (cbdata.cleanglobalid)
- exchange_mapi_util_free_binary_r (cbdata.cleanglobalid);
+ e_mapi_util_free_binary_r (cbdata.cleanglobalid);
cbdata.globalid = &globalid;
cbdata.cleanglobalid = &cleanglobalid;
- mid = exchange_mapi_connection_create_item (priv->conn, olFolderSentMail, 0,
- exchange_mapi_cal_utils_write_props_cb, &cbdata,
+ mid = e_mapi_connection_create_item (priv->conn, olFolderSentMail, 0,
+ e_mapi_cal_utils_write_props_cb, &cbdata,
recipients, attachments, streams, MAPI_OPTIONS_DELETE_ON_SUBMIT_FAILURE, &mapi_error);
cbdata.globalid = NULL;
cbdata.cleanglobalid = NULL;
@@ -2182,8 +2182,8 @@ ecbm_send_objects (ECalBackend *backend, EDataCal *cal, GCancellable *cancellabl
if (!mid) {
g_object_unref (comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_attachment_list (&attachments);
mapi_error_to_edc_error (error, mapi_error, OtherError, _("Failed to create item on a server"));
if (mapi_error)
g_error_free (mapi_error);
@@ -2191,8 +2191,8 @@ ecbm_send_objects (ECalBackend *backend, EDataCal *cal, GCancellable *cancellabl
}
g_object_unref (comp);
- exchange_mapi_util_free_recipient_list (&recipients);
- exchange_mapi_util_free_attachment_list (&attachments);
+ e_mapi_util_free_recipient_list (&recipients);
+ e_mapi_util_free_attachment_list (&attachments);
subcomp = icalcomponent_get_next_component (icalcomp,
e_cal_backend_get_kind (E_CAL_BACKEND (backend)));
@@ -2434,7 +2434,7 @@ ecbm_get_free_busy (ECalBackend *backend, EDataCal *cal, GCancellable *cancellab
return;
}
- if (!exchange_mapi_cal_utils_get_free_busy_data (priv->conn, users, start, end, freebusy, &mapi_error)) {
+ if (!e_mapi_cal_utils_get_free_busy_data (priv->conn, users, start, end, freebusy, &mapi_error)) {
mapi_error_to_edc_error (perror, mapi_error, OtherError, _("Failed to get Free/Busy data"));
if (mapi_error)
@@ -3025,7 +3025,7 @@ base_op_abstract (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellabl
op->opid = opid;
op->cancellable = cancellable;
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -3054,7 +3054,7 @@ str_op_abstract (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable
op->base.cancellable = cancellable;
op->str = g_strdup (str);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -3084,7 +3084,7 @@ str2_op_abstract (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellabl
op->str1 = g_strdup (str1);
op->str2 = g_strdup (str2);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
#define BASE_OP_DEF(_func, _ot) \
@@ -3134,7 +3134,7 @@ ecbm_op_open (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *c
op->base.cancellable = cancellable;
op->only_if_exists = only_if_exists;
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -3161,7 +3161,7 @@ ecbm_op_authenticate_user (ECalBackend *backend, GCancellable *cancellable, ECre
op->base.cancellable = cancellable;
op->credentials = e_credentials_new_clone (credentials);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
STR_OP_DEF (ecbm_op_get_backend_property, OP_GET_BACKEND_PROPERTY)
@@ -3197,7 +3197,7 @@ ecbm_op_modify_object (ECalBackend *backend, EDataCal *cal, guint32 opid, GCance
op->calobj = g_strdup (calobj);
op->mod = mod;
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -3228,7 +3228,7 @@ ecbm_op_remove_object (ECalBackend *backend, EDataCal *cal, guint32 opid, GCance
op->rid = g_strdup (rid);
op->mod = mod;
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -3259,7 +3259,7 @@ ecbm_op_discard_alarm (ECalBackend *backend, EDataCal *cal, guint32 opid, GCance
op->rid = g_strdup (rid);
op->auid = g_strdup (auid);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
STR_OP_DEF (ecbm_op_receive_objects, OP_RECEIVE_OBJECTS)
@@ -3288,7 +3288,7 @@ ecbm_op_start_view (ECalBackend *backend, EDataCalView *view)
op->base.ot = OP_START_VIEW;
op->view = g_object_ref (view);
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -3319,7 +3319,7 @@ ecbm_op_get_free_busy (ECalBackend *backend, EDataCal *cal, guint32 opid, GCance
op->start = start;
op->end = end;
- em_operation_queue_push (priv->op_queue, op);
+ e_mapi_operation_queue_push (priv->op_queue, op);
}
static void
@@ -3468,7 +3468,7 @@ e_cal_backend_mapi_init (ECalBackendMAPI *cbmapi)
priv->mutex = g_mutex_new ();
priv->updating_mutex = g_mutex_new ();
priv->populating_cache = FALSE;
- priv->op_queue = em_operation_queue_new ((EMOperationQueueFunc) ecbm_operation_cb, cbmapi);
+ priv->op_queue = e_mapi_operation_queue_new ((EMapiOperationQueueFunc) ecbm_operation_cb, cbmapi);
cbmapi->priv = priv;
diff --git a/src/camel/Makefile.am b/src/camel/Makefile.am
index fd81779..d2cb200 100644
--- a/src/camel/Makefile.am
+++ b/src/camel/Makefile.am
@@ -16,17 +16,17 @@ AM_CPPFLAGS = -I.. \
libcamelmapi_la_SOURCES = \
camel-mapi-provider.c \
camel-mapi-folder.c \
+ camel-mapi-folder-summary.c \
camel-mapi-store.c \
camel-mapi-store-summary.c \
- camel-mapi-summary.c \
camel-mapi-notifications.c \
camel-mapi-transport.c
noinst_HEADERS = \
camel-mapi-folder.h \
+ camel-mapi-folder-summary.h \
camel-mapi-store.h \
camel-mapi-store-summary.h \
- camel-mapi-summary.h \
camel-mapi-transport.h \
camel-mapi-notifications.h \
camel-mapi-private.h
diff --git a/src/camel/camel-mapi-summary.c b/src/camel/camel-mapi-folder-summary.c
similarity index 85%
rename from src/camel/camel-mapi-summary.c
rename to src/camel/camel-mapi-folder-summary.c
index 5e73aed..9082c3d 100644
--- a/src/camel/camel-mapi-summary.c
+++ b/src/camel/camel-mapi-folder-summary.c
@@ -32,10 +32,10 @@
#include <sys/stat.h>
#include "camel-mapi-folder.h"
-#include "camel-mapi-summary.h"
+#include "camel-mapi-folder-summary.h"
#include "camel-mapi-store.h"
-#define CAMEL_MAPI_SUMMARY_VERSION (1)
+#define CAMEL_MAPI_FOLDER_SUMMARY_VERSION (1)
/*Prototypes*/
static CamelFIRecord* mapi_summary_header_to_db (CamelFolderSummary *, GError **error);
@@ -49,17 +49,17 @@ static gboolean mapi_content_info_to_db (CamelFolderSummary *s, CamelMessageCont
/*End of Prototypes*/
-G_DEFINE_TYPE (CamelMapiSummary, camel_mapi_summary, CAMEL_TYPE_FOLDER_SUMMARY)
+G_DEFINE_TYPE (CamelMapiFolderSummary, camel_mapi_folder_summary, CAMEL_TYPE_FOLDER_SUMMARY)
static void
mapi_summary_finalize (GObject *object)
{
- CamelMapiSummary *mapi_summary = CAMEL_MAPI_SUMMARY (object);
+ CamelMapiFolderSummary *mapi_summary = CAMEL_MAPI_FOLDER_SUMMARY (object);
g_free (mapi_summary->sync_time_stamp);
/* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (camel_mapi_summary_parent_class)->finalize (object);
+ G_OBJECT_CLASS (camel_mapi_folder_summary_parent_class)->finalize (object);
}
static CamelMessageInfo *
@@ -70,7 +70,7 @@ mapi_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
CamelFolderSummaryClass *folder_summary_class;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
- camel_mapi_summary_parent_class);
+ camel_mapi_folder_summary_parent_class);
to = (CamelMapiMessageInfo *)folder_summary_class->message_info_clone(s, mi);
to->server_flags = from->server_flags;
@@ -82,7 +82,7 @@ mapi_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi)
}
static void
-camel_mapi_summary_class_init (CamelMapiSummaryClass *class)
+camel_mapi_folder_summary_class_init (CamelMapiFolderSummaryClass *class)
{
GObjectClass *object_class;
CamelFolderSummaryClass *folder_summary_class;
@@ -103,26 +103,26 @@ camel_mapi_summary_class_init (CamelMapiSummaryClass *class)
}
static void
-camel_mapi_summary_init (CamelMapiSummary *mapi_summary)
+camel_mapi_folder_summary_init (CamelMapiFolderSummary *mapi_summary)
{
}
/**
- * camel_mapi_summary_new:
+ * camel_mapi_folder_summary_new:
* @filename: the file to store the summary in.
*
- * This will create a new CamelMapiSummary object and read in the
+ * This will create a new CamelMapiFolderSummary object and read in the
* summary data from disk, if it exists.
*
- * Return value: A new CamelMapiSummary object.
+ * Return value: A new CamelMapiFolderSummary object.
**/
CamelFolderSummary *
-camel_mapi_summary_new (CamelFolder *folder, const gchar *filename)
+camel_mapi_folder_summary_new (CamelFolder *folder, const gchar *filename)
{
CamelFolderSummary *summary;
GError *local_error = NULL;
- summary = g_object_new (CAMEL_TYPE_MAPI_SUMMARY, "folder", folder, NULL);
+ summary = g_object_new (CAMEL_TYPE_MAPI_FOLDER_SUMMARY, "folder", folder, NULL);
camel_folder_summary_set_build_content (summary, TRUE);
camel_folder_summary_set_filename (summary, filename);
@@ -140,7 +140,7 @@ camel_mapi_summary_new (CamelFolder *folder, const gchar *filename)
}
void
-camel_mapi_summary_update_store_info_counts (CamelMapiSummary *mapi_summary)
+camel_mapi_folder_summary_update_store_info_counts (CamelMapiFolderSummary *mapi_summary)
{
CamelFolderSummary *summary;
@@ -180,12 +180,12 @@ camel_mapi_summary_update_store_info_counts (CamelMapiSummary *mapi_summary)
static gboolean
mapi_summary_header_from_db (CamelFolderSummary *summary, CamelFIRecord *fir)
{
- CamelMapiSummary *mapi_summary = CAMEL_MAPI_SUMMARY (summary);
+ CamelMapiFolderSummary *mapi_summary = CAMEL_MAPI_FOLDER_SUMMARY (summary);
CamelFolderSummaryClass *folder_summary_class;
gchar *part;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
- camel_mapi_summary_parent_class);
+ camel_mapi_folder_summary_parent_class);
if (!folder_summary_class->summary_header_from_db (summary, fir))
return FALSE;
@@ -206,21 +206,21 @@ mapi_summary_header_from_db (CamelFolderSummary *summary, CamelFIRecord *fir)
static CamelFIRecord *
mapi_summary_header_to_db (CamelFolderSummary *summary, GError **error)
{
- CamelMapiSummary *mapi_summary = CAMEL_MAPI_SUMMARY(summary);
+ CamelMapiFolderSummary *mapi_summary = CAMEL_MAPI_FOLDER_SUMMARY(summary);
CamelFolderSummaryClass *folder_summary_class;
struct _CamelFIRecord *fir;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
- camel_mapi_summary_parent_class);
+ camel_mapi_folder_summary_parent_class);
fir = folder_summary_class->summary_header_to_db (summary, error);
if (!fir)
return NULL;
- fir->bdata = g_strdup_printf ("%d %s", CAMEL_MAPI_SUMMARY_VERSION, mapi_summary->sync_time_stamp);
+ fir->bdata = g_strdup_printf ("%d %s", CAMEL_MAPI_FOLDER_SUMMARY_VERSION, mapi_summary->sync_time_stamp);
- camel_mapi_summary_update_store_info_counts (mapi_summary);
+ camel_mapi_folder_summary_update_store_info_counts (mapi_summary);
return fir;
}
@@ -232,7 +232,7 @@ mapi_message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
CamelMessageInfo *info;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
- camel_mapi_summary_parent_class);
+ camel_mapi_folder_summary_parent_class);
info = folder_summary_class->message_info_from_db (s, mir);
if (info) {
@@ -256,7 +256,7 @@ mapi_message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
struct _CamelMIRecord *mir;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
- camel_mapi_summary_parent_class);
+ camel_mapi_folder_summary_parent_class);
mir = folder_summary_class->message_info_to_db (s, info);
if (mir)
@@ -273,7 +273,7 @@ mapi_content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
guint32 type=0;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
- camel_mapi_summary_parent_class);
+ camel_mapi_folder_summary_parent_class);
if (part)
type = bdata_extract_digit (&part);
@@ -292,7 +292,7 @@ mapi_content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, C
CamelFolderSummaryClass *folder_summary_class;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
- camel_mapi_summary_parent_class);
+ camel_mapi_folder_summary_parent_class);
if (info->type) {
mir->cinfo = g_strdup ("1");
diff --git a/src/camel/camel-mapi-summary.h b/src/camel/camel-mapi-folder-summary.h
similarity index 59%
rename from src/camel/camel-mapi-summary.h
rename to src/camel/camel-mapi-folder-summary.h
index a657faa..713619d 100644
--- a/src/camel/camel-mapi-summary.h
+++ b/src/camel/camel-mapi-folder-summary.h
@@ -21,34 +21,34 @@
*
*/
-#ifndef CAMEL_MAPI_SUMMARY_H
-#define CAMEL_MAPI_SUMMARY_H
+#ifndef CAMEL_MAPI_FOLDER_SUMMARY_H
+#define CAMEL_MAPI_FOLDER_SUMMARY_H
#include <camel/camel.h>
/* Standard GObject macros */
-#define CAMEL_TYPE_MAPI_SUMMARY \
- (camel_mapi_summary_get_type ())
-#define CAMEL_MAPI_SUMMARY(obj) \
+#define CAMEL_TYPE_MAPI_FOLDER_SUMMARY \
+ (camel_mapi_folder_summary_get_type ())
+#define CAMEL_MAPI_FOLDER_SUMMARY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), CAMEL_TYPE_MAPI_SUMMARY, CamelMapiSummary))
-#define CAMEL_MAPI_SUMMARY_CLASS(cls) \
+ ((obj), CAMEL_TYPE_MAPI_FOLDER_SUMMARY, CamelMapiFolderSummary))
+#define CAMEL_MAPI_FOLDER_SUMMARY_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
- ((cls), CAMEL_TYPE_MAPI_SUMMARY, CamelMapiSummaryClass)
-#define CAMEL_IS_MAPI_SUMMARY(obj) \
+ ((cls), CAMEL_TYPE_MAPI_FOLDER_SUMMARY, CamelMapiFolderSummaryClass)
+#define CAMEL_IS_MAPI_FOLDER_SUMMARY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), CAMEL_TYPE_MAPI_SUMMARY))
-#define CAMEL_IS_MAPI_SUMMARY_CLASS(cls) \
+ ((obj), CAMEL_TYPE_MAPI_FOLDER_SUMMARY))
+#define CAMEL_IS_MAPI_FOLDER_SUMMARY_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
- ((cls), CAMEL_TYPE_MAPI_SUMMARY))
-#define CAMEL_MAPI_SUMMARY_GET_CLASS(obj) \
+ ((cls), CAMEL_TYPE_MAPI_FOLDER_SUMMARY))
+#define CAMEL_MAPI_FOLDER_SUMMARY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS \
- ((obj), CAMEL_TYPE_MAPI_SUMMARY, CamelMapiSummaryClass))
+ ((obj), CAMEL_TYPE_MAPI_FOLDER_SUMMARY, CamelMapiFolderSummaryClass))
G_BEGIN_DECLS
-typedef struct _CamelMapiSummary CamelMapiSummary;
-typedef struct _CamelMapiSummaryClass CamelMapiSummaryClass;
+typedef struct _CamelMapiFolderSummary CamelMapiFolderSummary;
+typedef struct _CamelMapiFolderSummaryClass CamelMapiFolderSummaryClass;
typedef struct _CamelMapiMessageInfo CamelMapiMessageInfo;
typedef struct _CamelMapiMessageContentInfo CamelMapiMessageContentInfo;
@@ -68,7 +68,7 @@ struct _CamelMapiMessageContentInfo {
CamelMessageContentInfo info;
};
-struct _CamelMapiSummary {
+struct _CamelMapiFolderSummary {
CamelFolderSummary parent;
gchar *sync_time_stamp;
@@ -76,17 +76,17 @@ struct _CamelMapiSummary {
guint32 validity;
};
-struct _CamelMapiSummaryClass {
+struct _CamelMapiFolderSummaryClass {
CamelFolderSummaryClass parent_class;
};
-GType camel_mapi_summary_get_type (void);
+GType camel_mapi_folder_summary_get_type (void);
-CamelFolderSummary *camel_mapi_summary_new (struct _CamelFolder *folder, const gchar *filename);
+CamelFolderSummary *camel_mapi_folder_summary_new (struct _CamelFolder *folder, const gchar *filename);
void mapi_summary_clear (CamelFolderSummary *summary, gboolean uncache);
-void camel_mapi_summary_update_store_info_counts (CamelMapiSummary *mapi_summary);
+void camel_mapi_folder_summary_update_store_info_counts (CamelMapiFolderSummary *mapi_summary);
G_END_DECLS
-#endif /* CAMEL_MAPI_SUMMARY_H*/
+#endif /* CAMEL_MAPI_FOLDER_SUMMARY_H*/
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index 4a33b11..1ba8a0b 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -31,17 +31,17 @@
#include <glib.h>
#include <libmapi/libmapi.h>
-#include <exchange-mapi-defs.h>
-#include <exchange-mapi-utils.h>
-#include <exchange-mapi-folder.h>
-#include <exchange-mapi-cal-utils.h>
-#include "exchange-mapi-mail-utils.h"
+#include <e-mapi-defs.h>
+#include <e-mapi-utils.h>
+#include <e-mapi-folder.h>
+#include <e-mapi-cal-utils.h>
+#include "e-mapi-mail-utils.h"
#include "camel-mapi-store.h"
#include "camel-mapi-store-summary.h"
#include "camel-mapi-folder.h"
#include "camel-mapi-private.h"
-#include "camel-mapi-summary.h"
+#include "camel-mapi-folder-summary.h"
#define DEBUG_FN( ) printf("----%p %s\n", g_thread_self(), G_STRFUNC);
#define SUMMARY_FETCH_BATCH_COUNT 150
@@ -159,7 +159,7 @@ fetch_items_summary_cb (FetchItemsCallbackData *item_data, gpointer data)
MailItem *item = g_new0(MailItem , 1);
if (camel_debug_start("mapi:folder")) {
- exchange_mapi_debug_dump_properties (item_data->conn, item_data->fid, item_data->properties, 3);
+ e_mapi_debug_dump_properties (item_data->conn, item_data->fid, item_data->properties, 3);
camel_debug_end();
}
@@ -193,11 +193,11 @@ fetch_items_summary_cb (FetchItemsCallbackData *item_data, gpointer data)
/* item->header.from = camel_internet_address_format_address (from_name, from_email); */
if (delivery_date) {
- item->header.recieved_time = exchange_mapi_util_filetime_to_time_t (delivery_date);
+ item->header.recieved_time = e_mapi_util_filetime_to_time_t (delivery_date);
}
if (last_modification_time) {
- item_modification_time.tv_sec = exchange_mapi_util_filetime_to_time_t (last_modification_time);
+ item_modification_time.tv_sec = e_mapi_util_filetime_to_time_t (last_modification_time);
item_modification_time.tv_usec = 0;
}
@@ -359,7 +359,7 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
/************************ First populate summary *************************/
mi = NULL;
pmi = NULL;
- msg_uid = exchange_mapi_util_mapi_ids_to_uid (item->fid, item->mid);
+ msg_uid = e_mapi_util_mapi_ids_to_uid (item->fid, item->mid);
pmi = camel_folder_summary_get (folder->summary, msg_uid);
if (pmi) {
@@ -384,7 +384,7 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
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);
+ mi->info.uid = e_mapi_util_mapi_ids_to_uid(item->fid, item->mid);
mi->info.subject = camel_pstring_strdup(item->header.subject);
mi->info.date_sent = mi->info.date_received = item->header.recieved_time;
mi->info.size = (guint32) item->header.size;
@@ -405,13 +405,13 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
/* Build a SRow structure */
aRow = &recip->out_SRow;
- type = (uint32_t *) exchange_mapi_util_find_row_propval (aRow, PR_RECIPIENT_TYPE);
+ type = (uint32_t *) e_mapi_util_find_row_propval (aRow, PR_RECIPIENT_TYPE);
if (type) {
name = recip->display_name;
- name = name ? name : exchange_mapi_util_find_row_propval (aRow, PR_DISPLAY_NAME_UNICODE);
- name = name ? name : exchange_mapi_util_find_row_propval (aRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
- name = name ? name : exchange_mapi_util_find_row_propval (aRow, PR_7BIT_DISPLAY_NAME_UNICODE);
+ name = name ? name : e_mapi_util_find_row_propval (aRow, PR_DISPLAY_NAME_UNICODE);
+ name = name ? name : e_mapi_util_find_row_propval (aRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
+ name = name ? name : e_mapi_util_find_row_propval (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 ? recip->email_id : "");
@@ -448,7 +448,7 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
gchar *from_email;
camel_service_lock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- from_email = exchange_mapi_connection_ex_to_smtp (camel_mapi_store_get_exchange_connection (mapi_store), item->header.from_email, NULL, NULL);
+ from_email = e_mapi_connection_ex_to_smtp (camel_mapi_store_get_exchange_connection (mapi_store), item->header.from_email, NULL, NULL);
camel_service_unlock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
g_free (item->header.from_email);
@@ -519,7 +519,7 @@ deleted_items_sync_cb (FetchItemsCallbackData *item_data, gpointer data)
{
guint32 msg_flags = CAMEL_MESSAGE_FOLDER_FLAGGED; /* to not have 0 in the hash table */
GHashTable *uids = data;
- gchar *msg_uid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid,
+ gchar *msg_uid = e_mapi_util_mapi_ids_to_uid (item_data->fid,
item_data->mid);
if ((item_data->msg_flags & MSGFLAG_READ) != 0)
@@ -586,7 +586,7 @@ mapi_sync_deleted (CamelSession *session,
server_messages = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
/*Get the UID list from server.*/
- exchange_mapi_connection_fetch_items (camel_mapi_store_get_exchange_connection (mapi_store), data->folder_id, NULL, NULL,
+ e_mapi_connection_fetch_items (camel_mapi_store_get_exchange_connection (mapi_store), data->folder_id, NULL, NULL,
NULL, NULL,
deleted_items_sync_cb, server_messages,
options | MAPI_OPTIONS_DONT_OPEN_MESSAGE, NULL);
@@ -663,7 +663,7 @@ mapi_sync_deleted (CamelSession *session,
if (camel_folder_change_info_changed (changes)) {
if (flags_changed)
- camel_mapi_summary_update_store_info_counts (CAMEL_MAPI_SUMMARY (CAMEL_FOLDER (mapi_folder)->summary));
+ camel_mapi_folder_summary_update_store_info_counts (CAMEL_MAPI_FOLDER_SUMMARY (CAMEL_FOLDER (mapi_folder)->summary));
camel_folder_changed (data->folder, changes);
}
camel_folder_change_info_free (changes);
@@ -676,7 +676,7 @@ mapi_sync_deleted (CamelSession *session,
camel_folder_summary_free_array (known_uids);
if (data->need_refresh) {
- CamelMapiSummary *mapi_summary = CAMEL_MAPI_SUMMARY (data->folder->summary);
+ CamelMapiFolderSummary *mapi_summary = CAMEL_MAPI_FOLDER_SUMMARY (data->folder->summary);
if (mapi_summary) {
camel_service_lock (CAMEL_SERVICE (parent_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
g_free (mapi_summary->sync_time_stamp);
@@ -696,7 +696,7 @@ mapi_sync_deleted_data_free (SyncDeletedData *data)
}
static gboolean
-mapi_camel_get_summary_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
+mapi_camel_get_summary_list (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
{
static const uint32_t summary_prop_list[] = {
PR_INTERNET_CPID,
@@ -719,7 +719,7 @@ mapi_camel_get_summary_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC
g_return_val_if_fail (props != NULL, FALSE);
- return exchange_mapi_utils_add_props_to_props_array (mem_ctx, props, summary_prop_list, G_N_ELEMENTS (summary_prop_list));
+ return e_mapi_utils_add_props_to_props_array (mem_ctx, props, summary_prop_list, G_N_ELEMENTS (summary_prop_list));
}
gboolean
@@ -735,7 +735,7 @@ camel_mapi_folder_fetch_summary (CamelStore *store, CamelFolder *folder, const m
camel_service_lock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- status = exchange_mapi_connection_fetch_items (camel_mapi_store_get_exchange_connection (mapi_store), fid, res, sort,
+ status = e_mapi_connection_fetch_items (camel_mapi_store_get_exchange_connection (mapi_store), fid, res, sort,
mapi_camel_get_summary_list, NULL,
fetch_items_summary_cb, fetch_data,
options, mapi_error);
@@ -753,7 +753,7 @@ mapi_refresh_folder(CamelFolder *folder, GCancellable *cancellable, GError **err
CamelMapiStore *mapi_store;
CamelMapiFolder *mapi_folder;
- CamelMapiSummary *mapi_summary;
+ CamelMapiFolderSummary *mapi_summary;
CamelService *service;
CamelSession *session;
CamelStore *parent_store;
@@ -775,7 +775,7 @@ mapi_refresh_folder(CamelFolder *folder, GCancellable *cancellable, GError **err
mapi_folder = CAMEL_MAPI_FOLDER (folder);
mapi_store = CAMEL_MAPI_STORE (parent_store);
- mapi_summary = CAMEL_MAPI_SUMMARY (folder->summary);
+ mapi_summary = CAMEL_MAPI_FOLDER_SUMMARY (folder->summary);
is_proxy = parent_store->flags & CAMEL_STORE_PROXY;
@@ -848,7 +848,7 @@ mapi_refresh_folder(CamelFolder *folder, GCancellable *cancellable, GError **err
sort->aSort[0].ulPropTag = PR_LAST_MODIFICATION_TIME;
sort->aSort[0].ulOrder = TABLE_SORT_ASCEND;
- exchange_mapi_util_mapi_id_from_string (folder_id, &temp_folder_id);
+ e_mapi_util_mapi_id_from_string (folder_id, &temp_folder_id);
if (!camel_mapi_store_connected (mapi_store, NULL)) {
/*BUG : Fix exception string.*/
@@ -1116,7 +1116,7 @@ mapi_folder_append_message_sync (CamelFolder *folder,
folder_id = camel_mapi_store_folder_id_lookup (mapi_store, full_name);
- exchange_mapi_util_mapi_id_from_string (folder_id, &fid);
+ e_mapi_util_mapi_id_from_string (folder_id, &fid);
/* Convert MIME to Item */
from = (CamelAddress *) camel_mime_message_get_from (message);
@@ -1125,7 +1125,7 @@ mapi_folder_append_message_sync (CamelFolder *folder,
if (item == NULL)
return FALSE;
- mid = exchange_mapi_connection_create_item (camel_mapi_store_get_exchange_connection (mapi_store), -1, fid,
+ mid = e_mapi_connection_create_item (camel_mapi_store_get_exchange_connection (mapi_store), -1, fid,
mapi_mail_utils_create_item_build_props, item,
item->recipients, item->attachments,
item->generic_streams, MAPI_OPTIONS_DONT_SUBMIT, &mapi_error);
@@ -1168,7 +1168,7 @@ mapi_folder_append_message_sync (CamelFolder *folder,
}
if (appended_uid)
- *appended_uid = exchange_mapi_util_mapi_ids_to_uid(fid, mid);
+ *appended_uid = e_mapi_util_mapi_ids_to_uid(fid, mid);
return TRUE;
}
@@ -1203,7 +1203,7 @@ mapi_folder_expunge_sync (CamelFolder *folder,
mapi_store = CAMEL_MAPI_STORE (parent_store);
folder_id = g_strdup (camel_mapi_store_folder_id_lookup (mapi_store, full_name));
- exchange_mapi_util_mapi_id_from_string (folder_id, &fid);
+ e_mapi_util_mapi_id_from_string (folder_id, &fid);
if ((mapi_folder->type & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_TRASH) {
GError *mapi_error = NULL;
@@ -1230,7 +1230,7 @@ mapi_folder_expunge_sync (CamelFolder *folder,
g_ptr_array_free (folders, TRUE);
camel_service_lock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- status = exchange_mapi_connection_empty_folder (camel_mapi_store_get_exchange_connection (mapi_store), fid, 0, &mapi_error);
+ status = e_mapi_connection_empty_folder (camel_mapi_store_get_exchange_connection (mapi_store), fid, 0, &mapi_error);
camel_service_unlock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
if (status) {
@@ -1262,7 +1262,7 @@ mapi_folder_expunge_sync (CamelFolder *folder,
const gchar *uid = camel_message_info_uid (info);
mapi_id_t *mid = g_new0 (mapi_id_t, 1);
- if (!exchange_mapi_util_mapi_ids_from_uid (uid, &fid, mid))
+ if (!e_mapi_util_mapi_ids_from_uid (uid, &fid, mid))
continue;
if (deleted_items)
@@ -1284,7 +1284,7 @@ mapi_folder_expunge_sync (CamelFolder *folder,
if (deleted_items) {
camel_service_lock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- status = exchange_mapi_connection_remove_items (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, 0, deleted_items, NULL);
+ status = e_mapi_connection_remove_items (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, 0, deleted_items, NULL);
camel_service_unlock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
@@ -1418,14 +1418,14 @@ mapi_folder_get_message_sync (CamelFolder *folder,
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);
+ e_mapi_util_mapi_ids_from_uid (uid, &id_folder, &id_message);
if (((CamelMapiFolder *)folder)->type & CAMEL_MAPI_FOLDER_PUBLIC) {
options |= MAPI_OPTIONS_USE_PFSTORE;
}
camel_service_lock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- exchange_mapi_connection_fetch_item (camel_mapi_store_get_exchange_connection (mapi_store), id_folder, id_message,
+ e_mapi_connection_fetch_item (camel_mapi_store_get_exchange_connection (mapi_store), id_folder, id_message,
mapi_mail_get_item_prop_list, NULL,
fetch_props_to_mail_item_cb, &item,
options, &mapi_error);
@@ -1547,7 +1547,7 @@ mapi_folder_synchronize_sync (CamelFolder *folder,
options |= MAPI_OPTIONS_USE_PFSTORE;
folder_id = camel_mapi_store_folder_id_lookup (mapi_store, full_name);
- exchange_mapi_util_mapi_id_from_string (folder_id, &fid);
+ e_mapi_util_mapi_id_from_string (folder_id, &fid);
camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
if (!camel_mapi_store_connected (mapi_store, NULL)) {
@@ -1577,7 +1577,7 @@ mapi_folder_synchronize_sync (CamelFolder *folder,
flags= camel_message_info_flags (info);
/* Why are we getting so much noise here :-/ */
- if (!exchange_mapi_util_mapi_ids_from_uid (uid, &temp_fid, mid)) {
+ if (!e_mapi_util_mapi_ids_from_uid (uid, &temp_fid, mid)) {
camel_message_info_free (info);
g_free (mid);
continue;
@@ -1631,13 +1631,13 @@ mapi_folder_synchronize_sync (CamelFolder *folder,
if (read_items) {
camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
- exchange_mapi_connection_set_flags (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, options, read_items, 0, NULL);
+ e_mapi_connection_set_flags (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, options, read_items, 0, NULL);
camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
}
if (unread_items) {
camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
- exchange_mapi_connection_set_flags (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, options, unread_items, CLEAR_READ_FLAG, NULL);
+ e_mapi_connection_set_flags (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, options, unread_items, CLEAR_READ_FLAG, NULL);
camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
}
@@ -1645,12 +1645,12 @@ mapi_folder_synchronize_sync (CamelFolder *folder,
if (deleted_items) {
camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
if ((mapi_folder->type & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_TRASH) {
- exchange_mapi_connection_remove_items (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, options, deleted_items, NULL);
+ e_mapi_connection_remove_items (camel_mapi_store_get_exchange_connection (mapi_store), 0, fid, options, deleted_items, NULL);
} else {
GError *err = NULL;
- exchange_mapi_util_mapi_id_from_string (camel_mapi_store_system_folder_fid (mapi_store, olFolderDeletedItems), &deleted_items_fid);
- exchange_mapi_connection_move_items (camel_mapi_store_get_exchange_connection (mapi_store), fid, options, deleted_items_fid, 0, deleted_items, &err);
+ e_mapi_util_mapi_id_from_string (camel_mapi_store_system_folder_fid (mapi_store, olFolderDeletedItems), &deleted_items_fid);
+ e_mapi_connection_move_items (camel_mapi_store_get_exchange_connection (mapi_store), fid, options, deleted_items_fid, 0, deleted_items, &err);
if (err) {
g_warning ("%s: Failed to move deleted items: %s", G_STRFUNC, err->message);
@@ -1666,8 +1666,8 @@ mapi_folder_synchronize_sync (CamelFolder *folder,
GError *err = NULL;
camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
- exchange_mapi_util_mapi_id_from_string (camel_mapi_store_system_folder_fid (mapi_store, olFolderJunk), &junk_fid);
- exchange_mapi_connection_move_items (camel_mapi_store_get_exchange_connection (mapi_store), fid, options, junk_fid, 0, junk_items, &err);
+ e_mapi_util_mapi_id_from_string (camel_mapi_store_system_folder_fid (mapi_store, olFolderJunk), &junk_fid);
+ e_mapi_connection_move_items (camel_mapi_store_get_exchange_connection (mapi_store), fid, options, junk_fid, 0, junk_items, &err);
camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
/* in junk_items are only emails which are not deleted */
@@ -1774,16 +1774,16 @@ mapi_folder_transfer_messages_to_sync (CamelFolder *source,
return FALSE;
folder_id = camel_mapi_store_folder_id_lookup (mapi_store, source_full_name);
- exchange_mapi_util_mapi_id_from_string (folder_id, &src_fid);
+ e_mapi_util_mapi_id_from_string (folder_id, &src_fid);
src_fid_options = (CAMEL_MAPI_FOLDER (source)->type & CAMEL_MAPI_FOLDER_PUBLIC) != 0 ? MAPI_OPTIONS_USE_PFSTORE : 0;
folder_id = camel_mapi_store_folder_id_lookup (mapi_store, destination_full_name);
- exchange_mapi_util_mapi_id_from_string (folder_id, &dest_fid);
+ e_mapi_util_mapi_id_from_string (folder_id, &dest_fid);
dest_fid_options = (CAMEL_MAPI_FOLDER (destination)->type & CAMEL_MAPI_FOLDER_PUBLIC) != 0 ? MAPI_OPTIONS_USE_PFSTORE : 0;
for (i=0; i < uids->len; i++) {
mapi_id_t *mid = g_new0 (mapi_id_t, 1); /* FIXME : */
- if (!exchange_mapi_util_mapi_ids_from_uid (g_ptr_array_index (uids, i), &src_fid, mid))
+ if (!e_mapi_util_mapi_ids_from_uid (g_ptr_array_index (uids, i), &src_fid, mid))
continue;
src_msg_ids = g_slist_prepend (src_msg_ids, mid);
@@ -1792,7 +1792,7 @@ mapi_folder_transfer_messages_to_sync (CamelFolder *source,
if (delete_originals) {
GError *err = NULL;
- if (!exchange_mapi_connection_move_items (camel_mapi_store_get_exchange_connection (mapi_store), src_fid, src_fid_options, dest_fid, dest_fid_options, src_msg_ids, &err)) {
+ if (!e_mapi_connection_move_items (camel_mapi_store_get_exchange_connection (mapi_store), src_fid, src_fid_options, dest_fid, dest_fid_options, src_msg_ids, &err)) {
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
"%s", err ? err->message : _("Unknown error"));
@@ -1813,7 +1813,7 @@ mapi_folder_transfer_messages_to_sync (CamelFolder *source,
} else {
GError *err = NULL;
- if (!exchange_mapi_connection_copy_items (camel_mapi_store_get_exchange_connection (mapi_store), src_fid, src_fid_options, dest_fid, dest_fid_options, src_msg_ids, &err)) {
+ if (!e_mapi_connection_copy_items (camel_mapi_store_get_exchange_connection (mapi_store), src_fid, src_fid_options, dest_fid, dest_fid_options, src_msg_ids, &err)) {
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
"%s", err ? err->message : _("Unknown error"));
@@ -1916,7 +1916,7 @@ camel_mapi_folder_new (CamelStore *store, const gchar *folder_name, const gchar
summary_file = g_strdup_printf ("%s/%s/summary",folder_dir, folder_name);
- folder->summary = camel_mapi_summary_new(folder, summary_file);
+ folder->summary = camel_mapi_folder_summary_new (folder, summary_file);
g_free(summary_file);
if (!folder->summary) {
diff --git a/src/camel/camel-mapi-folder.h b/src/camel/camel-mapi-folder.h
index 3216906..42b15e8 100644
--- a/src/camel/camel-mapi-folder.h
+++ b/src/camel/camel-mapi-folder.h
@@ -26,7 +26,7 @@
#include <camel/camel.h>
#include <libmapi/libmapi.h>
-#include <exchange-mapi-connection.h>
+#include <e-mapi-connection.h>
/* Standard GObject macros */
#define CAMEL_TYPE_MAPI_FOLDER \
diff --git a/src/camel/camel-mapi-notifications.c b/src/camel/camel-mapi-notifications.c
index f12d6e4..b96b685 100644
--- a/src/camel/camel-mapi-notifications.c
+++ b/src/camel/camel-mapi-notifications.c
@@ -38,10 +38,10 @@
#include "camel-mapi-store.h"
#include "camel-mapi-folder.h"
#include "camel-mapi-store-summary.h"
-#include "camel-mapi-summary.h"
+#include "camel-mapi-folder-summary.h"
#include "camel-mapi-notifications.h"
-#include <exchange-mapi-utils.h>
+#include <e-mapi-utils.h>
#define d_notifications(x) (camel_debug ("mapi:notifications") ? (x) : 0)
@@ -78,7 +78,7 @@ process_mapi_new_mail_notif (CamelMapiStore *store, struct NewMailNotification *
/* FIXME : Continue only if we are handling a mail object.*/
if (0) return;
- folder_id = exchange_mapi_util_mapi_id_to_string (new_mail_notif->FID);
+ folder_id = e_mapi_util_mapi_id_to_string (new_mail_notif->FID);
/* Get the folder object */
@@ -210,7 +210,7 @@ mapi_push_notification_listener_thread (gpointer data)
struct mapi_push_notification_data *thread_data = data;
CamelMapiStore *mapi_store = (CamelMapiStore *) thread_data->event_data;
struct mapi_notify_continue_callback_data *cb_data = g_new0 (struct mapi_notify_continue_callback_data, 1);
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
g_return_val_if_fail (data != NULL, NULL);
@@ -232,14 +232,14 @@ mapi_push_notification_listener_thread (gpointer data)
g_object_ref (conn);
- if (exchange_mapi_connection_events_init (conn, NULL)) {
- exchange_mapi_connection_events_subscribe (conn, thread_data->event_options, thread_data->event_mask,
+ if (e_mapi_connection_events_init (conn, NULL)) {
+ e_mapi_connection_events_subscribe (conn, thread_data->event_options, thread_data->event_mask,
&thread_data->connection, mapi_notifications_filter,
thread_data->event_data, NULL);
camel_service_unlock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- exchange_mapi_connection_events_monitor (conn, cb_data); /*Blocking call. Don't hold locks here*/
- exchange_mapi_connection_events_unsubscribe (conn, thread_data->connection, NULL);
+ e_mapi_connection_events_monitor (conn, cb_data); /*Blocking call. Don't hold locks here*/
+ e_mapi_connection_events_unsubscribe (conn, thread_data->connection, NULL);
} else
camel_service_unlock (CAMEL_SERVICE (mapi_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
diff --git a/src/camel/camel-mapi-store.c b/src/camel/camel-mapi-store.c
index 9b84963..4354073 100644
--- a/src/camel/camel-mapi-store.c
+++ b/src/camel/camel-mapi-store.c
@@ -37,10 +37,10 @@
#include "camel-mapi-folder.h"
#include "camel-mapi-settings.h"
#include "camel-mapi-store-summary.h"
-#include "camel-mapi-summary.h"
+#include "camel-mapi-folder-summary.h"
#include "camel-mapi-notifications.h"
-#include "account-setup-eplugin/exchange-mapi-account-listener.h"
-#include <exchange-mapi-utils.h>
+#include "account-setup-eplugin/e-mapi-account-listener.h"
+#include <e-mapi-utils.h>
//#define d(x) x
#include <sys/types.h>
@@ -53,7 +53,7 @@
#define d(x) printf("%s:%s:%s \n", G_STRLOC, G_STRFUNC, x)
struct _CamelMapiStorePrivate {
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
GHashTable *id_hash; /*get names from ids*/
GHashTable *name_hash;/*get ids from names*/
@@ -142,7 +142,7 @@ check_for_connection (CamelService *service, GError **error)
{
CamelMapiStore *store = CAMEL_MAPI_STORE (service);
- return store && store->priv->conn && exchange_mapi_connection_connected (store->priv->conn);
+ return store && store->priv->conn && e_mapi_connection_connected (store->priv->conn);
}
/* escapes backslashes with \5C and forward slashes with \2F */
@@ -259,7 +259,7 @@ mapi_get_folder_with_type (CamelStore *store, guint folder_type, GCancellable *c
static CamelFolderInfo *
mapi_convert_to_folder_info (CamelMapiStore *store,
- ExchangeMAPIFolder *folder,
+ EMapiFolder *folder,
GError **error)
{
gchar *name;
@@ -269,9 +269,9 @@ mapi_convert_to_folder_info (CamelMapiStore *store,
const gchar *par_name = NULL;
CamelFolderInfo *fi;
- name = escape_slash (exchange_mapi_folder_get_name (folder));
+ name = escape_slash (e_mapi_folder_get_name (folder));
- id = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", exchange_mapi_folder_get_fid (folder));
+ id = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", e_mapi_folder_get_fid (folder));
fi = camel_folder_info_new ();
@@ -314,7 +314,7 @@ mapi_convert_to_folder_info (CamelMapiStore *store,
NULL is found
*/
- mapi_id_folder = exchange_mapi_folder_get_parent_id (folder);
+ mapi_id_folder = e_mapi_folder_get_parent_id (folder);
parent = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", mapi_id_folder);
fi->display_name = name;
@@ -403,7 +403,7 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
return FALSE;
}
- status = exchange_mapi_connection_get_folders_list (priv->conn, &folder_list, &err);
+ status = e_mapi_connection_get_folders_list (priv->conn, &folder_list, &err);
if (!status) {
g_warning ("Could not get folder list (%s)\n", err ? err->message : "Unknown error");
@@ -434,7 +434,7 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
GError *err = NULL;
/*Consult the name <-> fid hash table for a FID.*/
- status = exchange_mapi_connection_get_pf_folders_list (priv->conn, &folder_list, &err);
+ status = e_mapi_connection_get_pf_folders_list (priv->conn, &folder_list, &err);
if (!status)
g_warning ("Could not get Public folder list (%s)\n", err ? err->message : "Unknown error");
@@ -451,20 +451,20 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
gchar *fid = NULL, *parent_id = NULL, *tmp = NULL;
guint *folder_type = g_new0 (guint, 1);
- fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", exchange_mapi_folder_get_fid((ExchangeMAPIFolder *)(temp_list->data)));
- parent_id = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", exchange_mapi_folder_get_parent_id ((ExchangeMAPIFolder *)(temp_list->data)));
+ fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", e_mapi_folder_get_fid((EMapiFolder *)(temp_list->data)));
+ parent_id = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", e_mapi_folder_get_parent_id ((EMapiFolder *)(temp_list->data)));
full_name = g_hash_table_lookup (priv->id_hash, fid);
if (!full_name) {
const gchar *par_full_name;
par_full_name = g_hash_table_lookup (priv->id_hash, parent_id);
if (par_full_name) {
- gchar *escaped = escape_slash (exchange_mapi_folder_get_name (temp_list->data));
+ gchar *escaped = escape_slash (e_mapi_folder_get_name (temp_list->data));
tmp = g_strconcat (par_full_name, "/", escaped, NULL);
full_name = tmp;
g_free (escaped);
} else {
- tmp = escape_slash (exchange_mapi_folder_get_name (temp_list->data));
+ tmp = escape_slash (e_mapi_folder_get_name (temp_list->data));
full_name = tmp;
}
} else {
@@ -475,12 +475,12 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
/* remove from here; what lefts is not on the server any more */
g_hash_table_remove (old_cache_folders, full_name);
- *folder_type = ((ExchangeMAPIFolder *)(temp_list->data))->container_class;
+ *folder_type = ((EMapiFolder *)(temp_list->data))->container_class;
mapi_update_folder_hash_tables (store, full_name, fid, parent_id);
mapi_update_hash_table_type (store, full_name, folder_type);
- if (((ExchangeMAPIFolder *)(temp_list->data))->is_default) {
+ if (((EMapiFolder *)(temp_list->data))->is_default) {
guint *type = g_new0 (guint, 1);
- *type = ((ExchangeMAPIFolder *)(temp_list->data))->default_type;
+ *type = ((EMapiFolder *)(temp_list->data))->default_type;
g_hash_table_insert (priv->default_folders, type,
g_strdup(fid));
}
@@ -490,7 +490,7 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
}
for (;folder_list != NULL; folder_list = g_slist_next (folder_list)) {
- ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *) folder_list->data;
+ EMapiFolder *folder = (EMapiFolder *) folder_list->data;
if (folder->default_type == olPublicFoldersAllPublicFolders)
continue;
@@ -504,9 +504,9 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
gchar *fid, *pfid = NULL;
fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X",
- exchange_mapi_folder_get_fid((ExchangeMAPIFolder *)(folder_list->data)));
+ e_mapi_folder_get_fid((EMapiFolder *)(folder_list->data)));
pfid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X",
- exchange_mapi_folder_get_parent_id((ExchangeMAPIFolder *)(folder_list->data)));
+ e_mapi_folder_get_parent_id((EMapiFolder *)(folder_list->data)));
mapi_si = camel_mapi_store_summary_add_from_full (store->summary, info->full_name, '/', fid, pfid);
g_free (fid);
@@ -533,9 +533,9 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
info = mapi_convert_to_folder_info (store, folder, NULL);
mapi_si = (CamelMapiStoreInfo *) camel_store_summary_path ((CamelStoreSummary *)store->summary, info->full_name);
fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X",
- exchange_mapi_folder_get_fid((ExchangeMAPIFolder *)(folder_list->data)));
+ e_mapi_folder_get_fid((EMapiFolder *)(folder_list->data)));
pfid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X",
- exchange_mapi_folder_get_parent_id((ExchangeMAPIFolder *)(folder_list->data)));
+ e_mapi_folder_get_parent_id((EMapiFolder *)(folder_list->data)));
mapi_si = camel_mapi_store_summary_add_from_full (store->summary, info->full_name, '/', fid, pfid);
g_free (fid);
g_free (pfid);
@@ -557,7 +557,7 @@ mapi_folders_sync (CamelMapiStore *store, guint32 flags, GError **error)
camel_store_summary_touch ((CamelStoreSummary *)store->summary);
camel_store_summary_save ((CamelStoreSummary *)store->summary);
- g_slist_foreach (list, (GFunc) exchange_mapi_folder_free, NULL);
+ g_slist_foreach (list, (GFunc) e_mapi_folder_free, NULL);
g_slist_free (list);
priv->folders_synced = TRUE;
@@ -1075,8 +1075,8 @@ mapi_store_create_folder_sync (CamelStore *store,
camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- exchange_mapi_util_mapi_id_from_string (parent_id, &parent_fid);
- new_folder_id = exchange_mapi_connection_create_folder (priv->conn, olFolderInbox, parent_fid, 0, folder_name, &mapi_error);
+ e_mapi_util_mapi_id_from_string (parent_id, &parent_fid);
+ new_folder_id = e_mapi_connection_create_folder (priv->conn, olFolderInbox, parent_fid, 0, folder_name, &mapi_error);
if (new_folder_id != 0) {
CamelMapiStoreInfo *si;
gchar *fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", new_folder_id);
@@ -1138,8 +1138,8 @@ mapi_store_delete_folder_sync (CamelStore *store,
}
folder_id = g_hash_table_lookup (priv->name_hash, folder_name);
- exchange_mapi_util_mapi_id_from_string (folder_id, &folder_fid);
- status = exchange_mapi_connection_remove_folder (priv->conn, folder_fid, 0, &local_error);
+ e_mapi_util_mapi_id_from_string (folder_id, &folder_fid);
+ status = e_mapi_connection_remove_folder (priv->conn, folder_fid, 0, &local_error);
if (status) {
/* Fixme ?? */
@@ -1250,7 +1250,7 @@ mapi_store_rename_folder_sync (CamelStore *store,
tmp = NULL;
}
- if (!exchange_mapi_util_mapi_id_from_string (old_fid_str, &old_fid)) {
+ if (!e_mapi_util_mapi_id_from_string (old_fid_str, &old_fid)) {
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Cannot rename MAPI folder '%s' to '%s'"),
@@ -1265,7 +1265,7 @@ mapi_store_rename_folder_sync (CamelStore *store,
gchar *folder_id;
/* renaming in the same folder, thus no MoveFolder necessary */
- if (!exchange_mapi_connection_rename_folder (priv->conn, old_fid, 0, tmp ? tmp : new_name, &local_error)) {
+ if (!e_mapi_connection_rename_folder (priv->conn, old_fid, 0, tmp ? tmp : new_name, &local_error)) {
if (local_error) {
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
@@ -1327,9 +1327,9 @@ mapi_store_rename_folder_sync (CamelStore *store,
camel_store_summary_info_free ((CamelStoreSummary *)mapi_store->summary, new_si);
}
} else if (!old_parent_fid_str || !new_parent_fid_str ||
- !exchange_mapi_util_mapi_id_from_string (old_parent_fid_str, &old_parent_fid) ||
- !exchange_mapi_util_mapi_id_from_string (new_parent_fid_str, &new_parent_fid) ||
- !exchange_mapi_connection_move_folder (priv->conn, old_fid, old_parent_fid, 0, new_parent_fid, 0, tmp, &local_error)) {
+ !e_mapi_util_mapi_id_from_string (old_parent_fid_str, &old_parent_fid) ||
+ !e_mapi_util_mapi_id_from_string (new_parent_fid_str, &new_parent_fid) ||
+ !e_mapi_connection_move_folder (priv->conn, old_fid, old_parent_fid, 0, new_parent_fid, 0, tmp, &local_error)) {
camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
if (local_error) {
g_set_error (
@@ -1431,7 +1431,7 @@ mapi_store_subscribe_folder_sync (CamelSubscribable *subscribable,
CamelFolderInfo *fi;
CamelStoreInfo *si = NULL;
const gchar *parent_name = NULL, *use_folder_name = folder_name, *fid = NULL;
- /* TODO : exchange_mapi_add_to_favorites (); */
+ /* TODO : e_mapi_add_to_favorites (); */
fid = camel_mapi_store_folder_id_lookup(mapi_store, folder_name);
@@ -1480,7 +1480,7 @@ mapi_store_subscribe_folder_sync (CamelSubscribable *subscribable,
guint folder_type = mapi_folders_hash_table_type_lookup (mapi_store, folder_name);
service = CAMEL_SERVICE (mapi_store);
- exchange_mapi_add_esource (service, use_folder_name, fid, folder_type);
+ e_mapi_add_esource (service, use_folder_name, fid, folder_type);
}
camel_store_summary_info_free((CamelStoreSummary *)mapi_store->summary, si);
return TRUE;
@@ -1530,7 +1530,7 @@ mapi_store_unsubscribe_folder_sync (CamelSubscribable *subscribable,
camel_folder_info_free (fi);
} else {
guint folder_type = mapi_folders_hash_table_type_lookup (mapi_store, use_folder_name);
- exchange_mapi_remove_esource (service, folder_name, fid, folder_type);
+ e_mapi_remove_esource (service, folder_name, fid, folder_type);
}
camel_store_summary_info_free ((CamelStoreSummary *)mapi_store->summary, si);
@@ -1781,7 +1781,7 @@ mapi_authenticate_sync (CamelService *service,
CamelSettings *settings;
CamelMapiSettings *mapi_settings;
CamelNetworkSettings *network_settings;
- ExchangeMapiProfileData empd = { 0 };
+ EMapiProfileData empd = { 0 };
const gchar *profile;
const gchar *password;
GError *mapi_error = NULL;
@@ -1792,12 +1792,12 @@ mapi_authenticate_sync (CamelService *service,
empd.server = camel_network_settings_get_host (network_settings);
empd.username = camel_network_settings_get_user (network_settings);
- exchange_mapi_util_profiledata_from_settings (&empd, mapi_settings);
+ e_mapi_util_profiledata_from_settings (&empd, mapi_settings);
profile = camel_mapi_settings_get_profile (mapi_settings);
if (empd.krb_sso) {
- if (exchange_mapi_util_trigger_krb_auth (&empd, error))
+ if (e_mapi_util_trigger_krb_auth (&empd, error))
return CAMEL_AUTHENTICATION_ACCEPTED;
else
return CAMEL_AUTHENTICATION_ERROR;
@@ -1813,8 +1813,8 @@ mapi_authenticate_sync (CamelService *service,
return CAMEL_AUTHENTICATION_ERROR;
}
- store->priv->conn = exchange_mapi_connection_new (profile, password, &mapi_error);
- if (store->priv->conn && exchange_mapi_connection_connected (store->priv->conn)) {
+ store->priv->conn = e_mapi_connection_new (profile, password, &mapi_error);
+ if (store->priv->conn && e_mapi_connection_connected (store->priv->conn)) {
result = CAMEL_AUTHENTICATION_ACCEPTED;
} else if (g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_LOGON_FAILED)) {
g_clear_error (&mapi_error);
@@ -2112,7 +2112,7 @@ camel_mapi_store_folder_lookup (CamelMapiStore *mapi_store, const gchar *folder_
return g_hash_table_lookup (priv->id_hash, folder_id);
}
-ExchangeMapiConnection *
+EMapiConnection *
camel_mapi_store_get_exchange_connection (CamelMapiStore *mapi_store)
{
g_return_val_if_fail (mapi_store != NULL, NULL);
diff --git a/src/camel/camel-mapi-store.h b/src/camel/camel-mapi-store.h
index b5a383c..79e6477 100644
--- a/src/camel/camel-mapi-store.h
+++ b/src/camel/camel-mapi-store.h
@@ -28,8 +28,8 @@
#include <camel/camel.h>
-#include <exchange-mapi-connection.h>
-#include <exchange-mapi-folder.h>
+#include <e-mapi-connection.h>
+#include <e-mapi-folder.h>
/* Standard GObject macros */
#define CAMEL_TYPE_MAPI_STORE \
@@ -99,7 +99,7 @@ const gchar * mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const
void camel_mapi_store_unset_notification_data (CamelMapiStore *mstore);
-ExchangeMapiConnection *camel_mapi_store_get_exchange_connection (CamelMapiStore *mapi_store);
+EMapiConnection *camel_mapi_store_get_exchange_connection (CamelMapiStore *mapi_store);
G_END_DECLS
diff --git a/src/camel/camel-mapi-transport.c b/src/camel/camel-mapi-transport.c
index 5dd7fb3..98df354 100644
--- a/src/camel/camel-mapi-transport.c
+++ b/src/camel/camel-mapi-transport.c
@@ -45,8 +45,8 @@
#include "camel-mapi-store-summary.h"
#define d(x)
-#include <exchange-mapi-defs.h>
-#include "exchange-mapi-mail-utils.h"
+#include <e-mapi-defs.h>
+#include "e-mapi-mail-utils.h"
#define STREAM_SIZE 4000
@@ -58,7 +58,7 @@ G_DEFINE_TYPE (CamelMapiTransport, camel_mapi_transport, CAMEL_TYPE_TRANSPORT)
/*CreateItem would return the MID of the new message or '0' if we fail.*/
static mapi_id_t
-mapi_message_item_send (ExchangeMapiConnection *conn, MailItem *item, GError **perror)
+mapi_message_item_send (EMapiConnection *conn, MailItem *item, GError **perror)
{
guint64 fid = 0;
mapi_id_t mid = 0;
@@ -73,7 +73,7 @@ mapi_message_item_send (ExchangeMapiConnection *conn, MailItem *item, GError **p
#undef unset
- mid = exchange_mapi_connection_create_item (conn, olFolderSentMail, fid,
+ mid = e_mapi_connection_create_item (conn, olFolderSentMail, fid,
mapi_mail_utils_create_item_build_props, item,
item->recipients, item->attachments, item->generic_streams, MAPI_OPTIONS_DELETE_ON_SUBMIT_FAILURE, perror);
@@ -88,7 +88,7 @@ mapi_send_to_sync (CamelTransport *transport,
GCancellable *cancellable,
GError **error)
{
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
MailItem *item = NULL;
const gchar *namep;
const gchar *addressp;
@@ -108,7 +108,7 @@ mapi_send_to_sync (CamelTransport *transport,
settings = camel_service_get_settings (service);
profile = camel_mapi_settings_get_profile (CAMEL_MAPI_SETTINGS (settings));
- conn = exchange_mapi_connection_find (profile);
+ conn = e_mapi_connection_find (profile);
if (!conn) {
g_set_error (
error, CAMEL_SERVICE_ERROR,
diff --git a/src/camel/camel-mapi-transport.h b/src/camel/camel-mapi-transport.h
index 49a34b3..e78f39e 100644
--- a/src/camel/camel-mapi-transport.h
+++ b/src/camel/camel-mapi-transport.h
@@ -26,7 +26,7 @@
#include <camel/camel.h>
#include <libmapi/libmapi.h>
-#include <exchange-mapi-connection.h>
+#include <e-mapi-connection.h>
/* Standard GObject macros */
#define CAMEL_TYPE_MAPI_TRANSPORT \
diff --git a/src/libexchangemapi/Makefile.am b/src/libexchangemapi/Makefile.am
index 2f343dd..78e8011 100644
--- a/src/libexchangemapi/Makefile.am
+++ b/src/libexchangemapi/Makefile.am
@@ -16,32 +16,32 @@ mapidata_DATA = \
tz-mapi-to-ical \
tz-ical-to-mapi
-libexchangemapi_1_0_la_SOURCES = \
- camel-mapi-settings.c \
- camel-mapi-settings.h \
- e-mapi-fast-transfer.h \
- e-mapi-fast-transfer.c \
- e-mapi-openchange.h \
- e-mapi-openchange.c \
- exchange-mapi-defs.h \
- exchange-mapi-folder.c \
- exchange-mapi-folder.h \
- exchange-mapi-connection.c \
- exchange-mapi-connection.h \
- exchange-mapi-debug.c \
- exchange-mapi-debug.h \
- exchange-mapi-utils.c \
- exchange-mapi-utils.h \
- exchange-mapi-cal-utils.c \
- exchange-mapi-cal-utils.h \
- exchange-mapi-cal-tz-utils.c \
- exchange-mapi-cal-tz-utils.h \
- exchange-mapi-cal-recur-utils.c \
- exchange-mapi-cal-recur-utils.h \
- exchange-mapi-mail-utils.c \
- exchange-mapi-mail-utils.h \
- em-operation-queue.c \
- em-operation-queue.h
+libexchangemapi_1_0_la_SOURCES = \
+ camel-mapi-settings.c \
+ camel-mapi-settings.h \
+ e-mapi-fast-transfer.h \
+ e-mapi-fast-transfer.c \
+ e-mapi-openchange.h \
+ e-mapi-openchange.c \
+ e-mapi-defs.h \
+ e-mapi-folder.c \
+ e-mapi-folder.h \
+ e-mapi-connection.c \
+ e-mapi-connection.h \
+ e-mapi-debug.c \
+ e-mapi-debug.h \
+ e-mapi-utils.c \
+ e-mapi-utils.h \
+ e-mapi-cal-utils.c \
+ e-mapi-cal-utils.h \
+ e-mapi-cal-tz-utils.c \
+ e-mapi-cal-tz-utils.h \
+ e-mapi-cal-recur-utils.c \
+ e-mapi-cal-recur-utils.h \
+ e-mapi-mail-utils.c \
+ e-mapi-mail-utils.h \
+ e-mapi-operation-queue.c \
+ e-mapi-operation-queue.h
libexchangemapi_1_0_la_LIBADD = \
@@ -55,17 +55,19 @@ libexchangemapi_1_0_la_LDFLAGS = $(NO_UNDEFINED)
libexchangemapiincludedir = $(edataserver_privincludedir)/mapi
-libexchangemapiinclude_HEADERS = \
- exchange-mapi-defs.h \
- exchange-mapi-folder.h \
- exchange-mapi-connection.h \
- exchange-mapi-debug.h \
- exchange-mapi-utils.h \
- exchange-mapi-cal-utils.h \
- exchange-mapi-cal-tz-utils.h \
- exchange-mapi-cal-recur-utils.h \
- exchange-mapi-mail-utils.h \
- em-operation-queue.h
+libexchangemapiinclude_HEADERS = \
+ e-mapi-defs.h \
+ e-mapi-folder.h \
+ e-mapi-connection.h \
+ e-mapi-debug.h \
+ e-mapi-fast-transfer.h \
+ e-mapi-utils.h \
+ e-mapi-cal-utils.h \
+ e-mapi-cal-tz-utils.h \
+ e-mapi-cal-recur-utils.h \
+ e-mapi-mail-utils.h \
+ e-mapi-openchange.h \
+ e-mapi-operation-queue.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libexchangemapi-$(EVO_MAPI_API_VERSION).pc
diff --git a/src/libexchangemapi/exchange-mapi-cal-recur-utils.c b/src/libexchangemapi/e-mapi-cal-recur-utils.c
similarity index 99%
rename from src/libexchangemapi/exchange-mapi-cal-recur-utils.c
rename to src/libexchangemapi/e-mapi-cal-recur-utils.c
index 458d499..f424b5d 100644
--- a/src/libexchangemapi/exchange-mapi-cal-recur-utils.c
+++ b/src/libexchangemapi/e-mapi-cal-recur-utils.c
@@ -25,7 +25,7 @@
#include <config.h>
#endif
-#include "exchange-mapi-cal-recur-utils.h"
+#include "e-mapi-cal-recur-utils.h"
#include <libecal/e-cal-util.h>
/* Reader/Writer versions */
@@ -699,7 +699,7 @@ check_calendar_type (guint16 type)
}
gboolean
-exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached, icaltimezone *recur_zone)
+e_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached, icaltimezone *recur_zone)
{
struct icalrecurrencetype rt;
struct ema_AppointmentRecurrencePattern arp;
@@ -1115,7 +1115,7 @@ compare_guint32 (gconstpointer a, gconstpointer b, gpointer user_data)
}
GByteArray *
-exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps)
+e_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps)
{
struct icalrecurrencetype *rt;
gint i;
diff --git a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h b/src/libexchangemapi/e-mapi-cal-recur-utils.h
similarity index 72%
copy from src/libexchangemapi/exchange-mapi-cal-recur-utils.h
copy to src/libexchangemapi/e-mapi-cal-recur-utils.h
index 6b95082..29c149d 100644
--- a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
+++ b/src/libexchangemapi/e-mapi-cal-recur-utils.h
@@ -21,18 +21,18 @@
*
*/
-#ifndef EXCHANGE_MAPI_CAL_RECUR_UTILS_H
-#define EXCHANGE_MAPI_CAL_RECUR_UTILS_H
+#ifndef E_MAPI_CAL_RECUR_UTILS_H
+#define E_MAPI_CAL_RECUR_UTILS_H
#include <glib.h>
-#include "exchange-mapi-cal-utils.h"
+#include "e-mapi-cal-utils.h"
G_BEGIN_DECLS
-gboolean exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached, icaltimezone *recur_zone);
+gboolean e_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached, icaltimezone *recur_zone);
-GByteArray * exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps);
+GByteArray * e_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps);
G_END_DECLS
diff --git a/src/libexchangemapi/exchange-mapi-cal-tz-utils.c b/src/libexchangemapi/e-mapi-cal-tz-utils.c
similarity index 75%
rename from src/libexchangemapi/exchange-mapi-cal-tz-utils.c
rename to src/libexchangemapi/e-mapi-cal-tz-utils.c
index 9e3ed84..f992c72 100644
--- a/src/libexchangemapi/exchange-mapi-cal-tz-utils.c
+++ b/src/libexchangemapi/e-mapi-cal-tz-utils.c
@@ -25,7 +25,7 @@
#include <config.h>
#endif
-#include "exchange-mapi-cal-tz-utils.h"
+#include "e-mapi-cal-tz-utils.h"
#define d(x)
@@ -37,14 +37,14 @@ static GHashTable *mapi_to_ical = NULL;
static GHashTable *ical_to_mapi = NULL;
const gchar *
-exchange_mapi_cal_tz_util_get_mapi_equivalent (const gchar *ical_tz_location)
+e_mapi_cal_tz_util_get_mapi_equivalent (const gchar *ical_tz_location)
{
const gchar *retval = NULL;
g_return_val_if_fail ((ical_tz_location && *ical_tz_location), NULL);
g_static_rec_mutex_lock(&mutex);
- if (!exchange_mapi_cal_tz_util_populate()) {
+ if (!e_mapi_cal_tz_util_populate()) {
g_static_rec_mutex_unlock(&mutex);
return NULL;
}
@@ -59,14 +59,14 @@ exchange_mapi_cal_tz_util_get_mapi_equivalent (const gchar *ical_tz_location)
}
const gchar *
-exchange_mapi_cal_tz_util_get_ical_equivalent (const gchar *mapi_tz_location)
+e_mapi_cal_tz_util_get_ical_equivalent (const gchar *mapi_tz_location)
{
const gchar *retval = NULL;
g_return_val_if_fail ((mapi_tz_location && *mapi_tz_location), NULL);
g_static_rec_mutex_lock(&mutex);
- if (!exchange_mapi_cal_tz_util_populate()) {
+ if (!e_mapi_cal_tz_util_populate()) {
g_static_rec_mutex_unlock(&mutex);
return NULL;
}
@@ -81,7 +81,7 @@ exchange_mapi_cal_tz_util_get_ical_equivalent (const gchar *mapi_tz_location)
}
void
-exchange_mapi_cal_tz_util_destroy ()
+e_mapi_cal_tz_util_destroy (void)
{
g_static_rec_mutex_lock(&mutex);
if (!(mapi_to_ical && ical_to_mapi)) {
@@ -119,7 +119,7 @@ file_contents_to_hashtable (const gchar *contents, GHashTable *table)
}
gboolean
-exchange_mapi_cal_tz_util_populate ()
+e_mapi_cal_tz_util_populate (void)
{
gchar *mtoi_fn = NULL, *itom_fn = NULL;
GMappedFile *mtoi_mf = NULL, *itom_mf = NULL;
@@ -176,7 +176,7 @@ exchange_mapi_cal_tz_util_populate ()
if (!(g_hash_table_size (mapi_to_ical) && g_hash_table_size (ical_to_mapi))) {
g_warning ("Exchange MAPI timezone files are not valid.");
- exchange_mapi_cal_tz_util_destroy ();
+ e_mapi_cal_tz_util_destroy ();
#if GLIB_CHECK_VERSION(2,21,3)
g_mapped_file_unref (mtoi_mf);
@@ -198,7 +198,7 @@ exchange_mapi_cal_tz_util_populate ()
g_mapped_file_free (itom_mf);
#endif
- d(exchange_mapi_cal_tz_util_dump ());
+ d(e_mapi_cal_tz_util_dump ());
g_static_rec_mutex_unlock(&mutex);
@@ -206,7 +206,7 @@ exchange_mapi_cal_tz_util_populate ()
}
static void
-exchange_mapi_cal_tz_util_dump_ical_tzs ()
+e_mapi_cal_tz_util_dump_ical_tzs (void)
{
guint i;
icalarray *zones;
@@ -241,14 +241,14 @@ exchange_mapi_cal_tz_util_dump_ical_tzs ()
}
void
-exchange_mapi_cal_tz_util_dump ()
+e_mapi_cal_tz_util_dump (void)
{
guint i;
GList *keys, *values, *l, *m;
g_static_rec_mutex_lock(&mutex);
- exchange_mapi_cal_tz_util_dump_ical_tzs ();
+ e_mapi_cal_tz_util_dump_ical_tzs ();
if (!(mapi_to_ical && ical_to_mapi)) {
g_static_rec_mutex_unlock(&mutex);
@@ -286,168 +286,6 @@ exchange_mapi_cal_tz_util_dump ()
g_static_rec_mutex_unlock(&mutex);
}
-#if 0
-const WORD TZRULE_FLAG_RECUR_CURRENT_TZREG = 0x0001; // see dispidApptTZDefRecur
-const WORD TZRULE_FLAG_EFFECTIVE_TZREG = 0x0002;
-
-// Allocates return value with new.
-// clean up with delete[].
-TZDEFINITION* BinToTZDEFINITION(ULONG cbDef, LPBYTE lpbDef)
-{
- if (!lpbDef) return NULL;
-
- // Update this if parsing code is changed!
- // this checks the size up to the flags member
- if (cbDef < 2*sizeof(BYTE) + 2*sizeof(WORD)) return NULL;
-
- TZDEFINITION tzDef;
- TZRULE* lpRules = NULL;
- LPBYTE lpPtr = lpbDef;
- WORD cchKeyName = 0;
- WCHAR* szKeyName = NULL;
- WORD i = 0;
-
- BYTE bMajorVersion = *((BYTE*)lpPtr);
- lpPtr += sizeof(BYTE);
- BYTE bMinorVersion = *((BYTE*)lpPtr);
- lpPtr += sizeof(BYTE);
-
- // We only understand TZ_BIN_VERSION_MAJOR
- if (TZ_BIN_VERSION_MAJOR != bMajorVersion) return NULL;
-
- // We only understand if >= TZ_BIN_VERSION_MINOR
- if (TZ_BIN_VERSION_MINOR > bMinorVersion) return NULL;
-
- WORD cbHeader = *((WORD*)lpPtr);
- lpPtr += sizeof(WORD);
-
- tzDef.wFlags = *((WORD*)lpPtr);
- lpPtr += sizeof(WORD);
-
- if (TZDEFINITION_FLAG_VALID_GUID & tzDef.wFlags)
- {
- if (lpbDef + cbDef - lpPtr < sizeof(GUID)) return NULL;
- tzDef.guidTZID = *((GUID*)lpPtr);
- lpPtr += sizeof(GUID);
- }
-
- if (TZDEFINITION_FLAG_VALID_KEYNAME & tzDef.wFlags)
- {
- if (lpbDef + cbDef - lpPtr < sizeof(WORD)) return NULL;
- cchKeyName = *((WORD*)lpPtr);
- lpPtr += sizeof(WORD);
- if (cchKeyName)
- {
- if (lpbDef + cbDef - lpPtr < (BYTE)sizeof(WORD)*cchKeyName) return NULL;
- szKeyName = (WCHAR*)lpPtr;
- lpPtr += cchKeyName*sizeof(WORD);
- }
- }
-
- if (lpbDef+ cbDef - lpPtr < sizeof(WORD)) return NULL;
- tzDef.cRules = *((WORD*)lpPtr);
- lpPtr += sizeof(WORD);
-
- /* FIXME: parse rules */
- if (tzDef.cRules) tzDef.cRules = 0;
-#if 0
- if (tzDef.cRules)
- {
- lpRules = new TZRULE[tzDef.cRules];
- if (!lpRules) return NULL;
-
- LPBYTE lpNextRule = lpPtr;
- BOOL bRuleOK = false;
-
- for (i = 0;i < tzDef.cRules;i++)
- {
- bRuleOK = false;
- lpPtr = lpNextRule;
-
- 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);
- lpPtr += sizeof(SYSTEMTIME);
- }
- if (!bRuleOK)
- {
- delete[] lpRules;
- return NULL;
- }
- }
-#endif
- // Now we've read everything - allocate a structure and copy it in
- gsize cbTZDef = sizeof(TZDEFINITION) +
- sizeof(WCHAR)*(cchKeyName+1) +
- sizeof(TZRULE)*tzDef.cRules;
-
- TZDEFINITION* ptzDef = (TZDEFINITION*) malloc (cbTZDef);
-
- if (ptzDef)
- {
- // Copy main struct over
- *ptzDef = tzDef;
- lpPtr = (LPBYTE) ptzDef;
- lpPtr += sizeof(TZDEFINITION);
-
- if (szKeyName)
- {
- ptzDef->pwszKeyName = (WCHAR*)lpPtr;
- memcpy(lpPtr,szKeyName,cchKeyName*sizeof(WCHAR));
- ptzDef->pwszKeyName[cchKeyName] = 0;
- lpPtr += (cchKeyName+1)*sizeof(WCHAR);
- }
-
- if (ptzDef -> cRules)
- {
- ptzDef -> rgRules = (TZRULE*)lpPtr;
- for (i = 0;i < ptzDef -> cRules;i++)
- {
- ptzDef -> rgRules[i] = lpRules[i];
- }
- }
- }
-// delete[] lpRules;
-
- free (ptzDef);
- ptzDef = NULL;
-
- return ptzDef;
-}
-#endif
-
#define TZDEFINITION_FLAG_VALID_GUID 0x0001 // the guid is valid
#define TZDEFINITION_FLAG_VALID_KEYNAME 0x0002 // the keyname is valid
#define TZ_MAX_RULES 1024
@@ -455,7 +293,7 @@ TZDEFINITION* BinToTZDEFINITION(ULONG cbDef, LPBYTE lpbDef)
#define TZ_BIN_VERSION_MINOR 0x01
void
-exchange_mapi_cal_util_mapi_tz_to_bin (const gchar *mapi_tzid, struct Binary_r *sb)
+e_mapi_cal_util_mapi_tz_to_bin (const gchar *mapi_tzid, struct Binary_r *sb)
{
GByteArray *ba;
guint8 flag8;
@@ -506,7 +344,7 @@ exchange_mapi_cal_util_mapi_tz_to_bin (const gchar *mapi_tzid, struct Binary_r *
}
gchar *
-exchange_mapi_cal_util_bin_to_mapi_tz (GByteArray *ba)
+e_mapi_cal_util_bin_to_mapi_tz (GByteArray *ba)
{
guint8 flag8;
guint16 flag16, cbHeader = 0;
@@ -683,7 +521,7 @@ nth_day_of_month (int year, int month, int wday, int ordinal)
/* return the most-correct PidLidTimeZone value w.r.t. OXOCAL 2.2.5.6. */
int
-exchange_mapi_cal_util_mapi_tz_pidlidtimezone (icaltimezone *ictz)
+e_mapi_cal_util_mapi_tz_pidlidtimezone (icaltimezone *ictz)
{
gboolean tz_dst_now = FALSE, tz_has_dst = FALSE;
int i, utc_offset = 0, best_index = 0, best_score = -1;
diff --git a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h b/src/libexchangemapi/e-mapi-cal-tz-utils.h
similarity index 60%
rename from src/libexchangemapi/exchange-mapi-cal-recur-utils.h
rename to src/libexchangemapi/e-mapi-cal-tz-utils.h
index 6b95082..5a789b4 100644
--- a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
+++ b/src/libexchangemapi/e-mapi-cal-tz-utils.h
@@ -21,20 +21,24 @@
*
*/
-#ifndef EXCHANGE_MAPI_CAL_RECUR_UTILS_H
-#define EXCHANGE_MAPI_CAL_RECUR_UTILS_H
+#ifndef E_MAPI_CAL_TZ_UTILS_H
+#define E_MAPI_CAL_TZ_UTILS_H
#include <glib.h>
-#include "exchange-mapi-cal-utils.h"
+#include "e-mapi-cal-utils.h"
G_BEGIN_DECLS
-gboolean exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached, icaltimezone *recur_zone);
-
-GByteArray * exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps);
+const gchar * e_mapi_cal_tz_util_get_mapi_equivalent (const gchar *ical_tz_location);
+const gchar * e_mapi_cal_tz_util_get_ical_equivalent (const gchar *mapi_tz_location);
+gboolean e_mapi_cal_tz_util_populate (void);
+void e_mapi_cal_tz_util_destroy (void);
+void e_mapi_cal_tz_util_dump (void);
+void e_mapi_cal_util_mapi_tz_to_bin (const gchar *mapi_tzid, struct Binary_r *sb);
+int e_mapi_cal_util_mapi_tz_pidlidtimezone (icaltimezone *ictz);
+gchar * e_mapi_cal_util_bin_to_mapi_tz (GByteArray *ba);
G_END_DECLS
#endif
-
diff --git a/src/libexchangemapi/exchange-mapi-cal-utils.c b/src/libexchangemapi/e-mapi-cal-utils.c
similarity index 84%
rename from src/libexchangemapi/exchange-mapi-cal-utils.c
rename to src/libexchangemapi/e-mapi-cal-utils.c
index 03e4b17..e863e1f 100644
--- a/src/libexchangemapi/exchange-mapi-cal-utils.c
+++ b/src/libexchangemapi/e-mapi-cal-utils.c
@@ -30,7 +30,7 @@
#include <fcntl.h>
#include <libecal/e-cal-util.h>
#include <libedataserver/e-data-server-util.h>
-#include "exchange-mapi-cal-utils.h"
+#include "e-mapi-cal-utils.h"
#ifndef O_BINARY
#define O_BINARY 0
@@ -43,9 +43,9 @@
#define d(x)
-static gboolean appt_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props);
-static gboolean task_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props);
-static gboolean note_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props);
+static gboolean appt_build_name_id (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props);
+static gboolean task_build_name_id (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props);
+static gboolean note_build_name_id (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props);
static icalparameter_role
get_role_from_type (OlMailRecipientType type)
@@ -204,7 +204,7 @@ get_imp_prop_from_priority (gint priority)
}
void
-exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_list, const gchar *local_store_uri)
+e_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;
@@ -277,7 +277,7 @@ exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_l
g_mapped_file_free (mapped_file);
#endif
} else if (error) {
- exchange_mapi_debug_print ("Could not map %s: %s \n", sfname_uri, error->message);
+ e_mapi_debug_print ("Could not map %s: %s \n", sfname_uri, error->message);
g_error_free (error);
}
@@ -295,7 +295,7 @@ exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_l
#define RECIP_ORGANIZER 0x2
void
-exchange_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list)
+e_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list)
{
icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
icalproperty *org_prop = NULL;
@@ -362,7 +362,7 @@ exchange_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list
}
void
-exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_list)
+e_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;
@@ -466,16 +466,16 @@ set_attachments_to_cal_component (ECalComponent *comp, GSList *attach_list, cons
guint len;
gint fd = -1;
- stream = exchange_mapi_util_find_stream (attach_item->streams, PR_ATTACH_DATA_BIN);
+ stream = e_mapi_util_find_stream (attach_item->streams, PR_ATTACH_DATA_BIN);
if (!stream)
continue;
attach = (const gchar *)stream->value->data;
len = stream->value->len;
- str = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_LONG_FILENAME_UNICODE);
+ str = (const gchar *) e_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_LONG_FILENAME_UNICODE);
if (!(str && *str))
- str = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_FILENAME_UNICODE);
+ str = (const gchar *) e_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_FILENAME_UNICODE);
filename = g_strconcat (local_store_uri, G_DIR_SEPARATOR_S, safeuid, "-", str, NULL);
attach_file_url = g_filename_to_uri (filename, NULL, &error);
@@ -489,10 +489,10 @@ set_attachments_to_cal_component (ECalComponent *comp, GSList *attach_list, cons
fd = g_open (filename, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0600);
if (fd == -1) {
/* skip gracefully */
- exchange_mapi_debug_print ("Could not open %s for writing \n", filename);
+ e_mapi_debug_print ("Could not open %s for writing \n", filename);
} else if (len && write (fd, attach, len) == -1) {
/* skip gracefully */
- exchange_mapi_debug_print ("Attachment write failed \n");
+ e_mapi_debug_print ("Attachment write failed \n");
}
if (fd != -1) {
close (fd);
@@ -533,9 +533,9 @@ ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients, gboolea
/* CN */
str = recip->display_name;
if (!str || !*str)
- str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
+ str = (const gchar *) e_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
if (!str)
- str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME_UNICODE);
+ str = (const gchar *) e_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME_UNICODE);
if (str) {
param = icalparameter_new_cn (str);
icalproperty_add_parameter (prop, param);
@@ -546,9 +546,9 @@ ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients, gboolea
/* CN */
str = recip->display_name;
if (!str || !*str)
- str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
+ str = (const gchar *) e_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
if (!str)
- str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME_UNICODE);
+ str = (const gchar *) e_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME_UNICODE);
if (str) {
param = icalparameter_new_cn (str);
icalproperty_add_parameter (prop, param);
@@ -590,7 +590,7 @@ static const uint8_t GID_START_SEQ[] = {
creation_time is a value of PR_CREATION_TIME
*/
void
-exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const gchar *uid, const struct timeval *exception_replace_time, const struct FILETIME *creation_time, struct Binary_r *sb)
+e_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const gchar *uid, const struct timeval *exception_replace_time, const struct FILETIME *creation_time, struct Binary_r *sb)
{
GByteArray *ba;
guint32 val32;
@@ -675,7 +675,7 @@ globalid_to_string (GByteArray *ba)
}
ECalComponent *
-exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id_t fid, icalcomponent_kind kind, const gchar *mid, struct mapi_SPropValue_array *properties,
+e_mapi_cal_util_mapi_props_to_comp (EMapiConnection *conn, mapi_id_t fid, 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 is_reply, GSList **detached_components)
{
@@ -707,17 +707,17 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
utc_zone = icaltimezone_get_utc_timezone ();
- subject = (const gchar *)exchange_mapi_util_find_array_propval(properties, PR_SUBJECT_UNICODE);
+ subject = (const gchar *)e_mapi_util_find_array_propval(properties, PR_SUBJECT_UNICODE);
if (!subject)
- subject = (const gchar *)exchange_mapi_util_find_array_propval(properties, PR_NORMALIZED_SUBJECT_UNICODE);
+ subject = (const gchar *)e_mapi_util_find_array_propval(properties, PR_NORMALIZED_SUBJECT_UNICODE);
if (!subject)
- subject = (const gchar *)exchange_mapi_util_find_array_propval(properties, PR_CONVERSATION_TOPIC_UNICODE);
+ subject = (const gchar *)e_mapi_util_find_array_propval(properties, PR_CONVERSATION_TOPIC_UNICODE);
if (!subject)
subject = "";
- body = (const gchar *)exchange_mapi_util_find_array_propval(properties, PR_BODY_UNICODE);
+ body = (const gchar *)e_mapi_util_find_array_propval(properties, PR_BODY_UNICODE);
if (!body) {
- body_stream = exchange_mapi_util_find_stream (streams, PR_HTML);
+ body_stream = e_mapi_util_find_stream (streams, PR_HTML);
body = body_stream ? (const gchar *) body_stream->value->data : "";
}
@@ -738,7 +738,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
icalcomponent_set_summary (ical_comp, subject);
icalcomponent_set_description (ical_comp, body);
- categories_array = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidNameKeywords);
+ categories_array = e_mapi_util_find_array_namedid (properties, conn, fid, PidNameKeywords);
if (categories_array) {
GSList *categories = NULL;
gint ii;
@@ -764,7 +764,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
ExchangeMAPIStream *stream;
/* GlobalObjectId */
- stream = exchange_mapi_util_find_stream_namedid (streams, conn, fid, PidLidGlobalObjectId);
+ stream = e_mapi_util_find_stream_namedid (streams, conn, fid, PidLidGlobalObjectId);
if (stream) {
gchar *value = globalid_to_string (stream->value);
prop = icalproperty_new_x (value);
@@ -785,7 +785,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
ui32 = find_mapi_SPropValue_data(properties, PR_OWNER_APPT_ID);
if (ui32) {
- gchar *value = exchange_mapi_util_mapi_id_to_string ((mapi_id_t) (*ui32));
+ gchar *value = e_mapi_util_mapi_id_to_string ((mapi_id_t) (*ui32));
prop = icalproperty_new_x (value);
icalproperty_set_x_name (prop, "X-EVOLUTION-MAPI-OWNER-APPT-ID");
@@ -794,7 +794,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
}
/* AppointmentSequence */
- ui32 = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidAppointmentSequence);
+ ui32 = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidAppointmentSequence);
if (ui32) {
gchar *value = g_strdup_printf ("%d", *ui32);
prop = icalproperty_new_x (value);
@@ -803,21 +803,21 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
g_free (value);
}
- location = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidLocation);
+ location = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidLocation);
if (location && *location)
icalcomponent_set_location (ical_comp, location);
- b = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidAppointmentSubType);;
+ b = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidAppointmentSubType);;
all_day = b && *b;
- stream = exchange_mapi_util_find_stream_namedid (streams, conn, fid, PidLidAppointmentTimeZoneDefinitionStartDisplay);
+ stream = e_mapi_util_find_stream_namedid (streams, conn, fid, PidLidAppointmentTimeZoneDefinitionStartDisplay);
if (stream) {
- gchar *buf = exchange_mapi_cal_util_bin_to_mapi_tz (stream->value);
- dtstart_tz_location = exchange_mapi_cal_tz_util_get_ical_equivalent (buf);
+ gchar *buf = e_mapi_cal_util_bin_to_mapi_tz (stream->value);
+ dtstart_tz_location = e_mapi_cal_tz_util_get_ical_equivalent (buf);
g_free (buf);
}
- if (exchange_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidAppointmentStartWhole) == MAPI_E_SUCCESS) {
+ if (e_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidAppointmentStartWhole) == MAPI_E_SUCCESS) {
icaltimezone *zone = dtstart_tz_location ? icaltimezone_get_builtin_timezone (dtstart_tz_location) : (icaltimezone *)default_zone;
prop = icalproperty_new_dtstart (icaltime_from_timet_with_zone (t.tv_sec, all_day, zone));
if (!all_day && zone && icaltimezone_get_tzid (zone)) {
@@ -827,14 +827,14 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
icalcomponent_add_property (ical_comp, prop);
}
- stream = exchange_mapi_util_find_stream_namedid (streams, conn, fid, PidLidAppointmentTimeZoneDefinitionEndDisplay);
+ stream = e_mapi_util_find_stream_namedid (streams, conn, fid, PidLidAppointmentTimeZoneDefinitionEndDisplay);
if (stream) {
- gchar *buf = exchange_mapi_cal_util_bin_to_mapi_tz (stream->value);
- dtend_tz_location = exchange_mapi_cal_tz_util_get_ical_equivalent (buf);
+ gchar *buf = e_mapi_cal_util_bin_to_mapi_tz (stream->value);
+ dtend_tz_location = e_mapi_cal_tz_util_get_ical_equivalent (buf);
g_free (buf);
}
- if (exchange_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidAppointmentEndWhole) == MAPI_E_SUCCESS) {
+ if (e_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidAppointmentEndWhole) == MAPI_E_SUCCESS) {
icaltimezone *zone;
if (!dtend_tz_location)
@@ -849,7 +849,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
icalcomponent_add_property (ical_comp, prop);
}
- ui32 = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidBusyStatus);
+ ui32 = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidBusyStatus);
if (ui32) {
prop = icalproperty_new_transp (get_transp_from_prop (*ui32));
icalcomponent_add_property (ical_comp, prop);
@@ -861,9 +861,9 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
if (is_reply) {
if (icalcomponent_get_first_property (ical_comp, ICAL_ORGANIZER_PROPERTY) == NULL) {
gchar *val, *to_free = NULL;
- const gchar *name = exchange_mapi_util_find_array_propval (properties, PR_RCVD_REPRESENTING_NAME_UNICODE);
- const gchar *email_type = exchange_mapi_util_find_array_propval (properties, PR_RCVD_REPRESENTING_ADDRTYPE_UNICODE);
- const gchar *email = exchange_mapi_util_find_array_propval (properties, PR_RCVD_REPRESENTING_EMAIL_ADDRESS_UNICODE);
+ const gchar *name = e_mapi_util_find_array_propval (properties, PR_RCVD_REPRESENTING_NAME_UNICODE);
+ const gchar *email_type = e_mapi_util_find_array_propval (properties, PR_RCVD_REPRESENTING_ADDRTYPE_UNICODE);
+ const gchar *email = e_mapi_util_find_array_propval (properties, PR_RCVD_REPRESENTING_EMAIL_ADDRESS_UNICODE);
if (!name)
name = "";
@@ -873,7 +873,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
email = "";
if (g_str_equal (email_type, "EX")) {
- to_free = exchange_mapi_connection_ex_to_smtp (conn, email, NULL, NULL);
+ to_free = e_mapi_connection_ex_to_smtp (conn, email, NULL, NULL);
email = to_free;
}
@@ -893,9 +893,9 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
if (icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY) == NULL) {
const uint32_t *ui32;
gchar *val, *to_free = NULL;
- const gchar *name = exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME_UNICODE);
- const gchar *email_type = exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE_UNICODE);
- const gchar *email = exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE);
+ const gchar *name = e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME_UNICODE);
+ const gchar *email_type = e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE_UNICODE);
+ const gchar *email = e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE);
if (!name)
name = "";
@@ -905,7 +905,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
email = "";
if (g_str_equal (email_type, "EX")) {
- to_free = exchange_mapi_connection_ex_to_smtp (conn, email, NULL, NULL);
+ to_free = e_mapi_connection_ex_to_smtp (conn, email, NULL, NULL);
email = to_free;
}
@@ -917,7 +917,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
param = icalparameter_new_cn (name);
icalproperty_add_parameter (prop, param);
- ui32 = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidResponseStatus);
+ ui32 = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidResponseStatus);
param = icalparameter_new_partstat (get_partstat_from_trackstatus (ui32 ? *ui32 : olResponseNone));
icalproperty_add_parameter (prop, param);
@@ -927,18 +927,18 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
}
} else if (icalcomponent_get_first_property (ical_comp, ICAL_ORGANIZER_PROPERTY) == NULL) {
gchar *val, *sender_free = NULL, *sent_free = NULL;
- const gchar *sender_email_type = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE_UNICODE);
- const gchar *sender_email = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS_UNICODE);
- const gchar *sent_name = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME_UNICODE);
- const gchar *sent_email_type = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE_UNICODE);
- const gchar *sent_email = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE);
+ const gchar *sender_email_type = (const gchar *) e_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE_UNICODE);
+ const gchar *sender_email = (const gchar *) e_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS_UNICODE);
+ const gchar *sent_name = (const gchar *) e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME_UNICODE);
+ const gchar *sent_email_type = (const gchar *) e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE_UNICODE);
+ const gchar *sent_email = (const gchar *) e_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE);
if (!g_utf8_collate (sender_email_type, "EX")) {
- sender_free = exchange_mapi_connection_ex_to_smtp (conn, sender_email, NULL, NULL);
+ sender_free = e_mapi_connection_ex_to_smtp (conn, sender_email, NULL, NULL);
sender_email = sender_free;
}
if (!g_utf8_collate (sent_email_type, "EX")) {
- sent_free = exchange_mapi_connection_ex_to_smtp (conn, sent_email, NULL, NULL);
+ sent_free = e_mapi_connection_ex_to_smtp (conn, sent_email, NULL, NULL);
sent_email = sent_free;
}
@@ -963,28 +963,28 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
}
}
- b = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidRecurring);
+ b = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidRecurring);
if (b && *b) {
- stream = exchange_mapi_util_find_stream_namedid (streams, conn, fid, PidLidAppointmentRecur);
+ stream = e_mapi_util_find_stream_namedid (streams, conn, fid, PidLidAppointmentRecur);
if (stream) {
icaltimezone *recur_zone;
const gchar *recur_tz_location;
- recur_tz_location = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidTimeZoneDescription);
+ recur_tz_location = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidTimeZoneDescription);
if (recur_tz_location)
- recur_tz_location = exchange_mapi_cal_tz_util_get_ical_equivalent (recur_tz_location);
+ recur_tz_location = e_mapi_cal_tz_util_get_ical_equivalent (recur_tz_location);
recur_zone = recur_tz_location ? icaltimezone_get_builtin_timezone (recur_tz_location) : (icaltimezone *) default_zone;
- exchange_mapi_cal_util_bin_to_rrule (stream->value, comp, detached_components, recur_zone);
+ e_mapi_cal_util_bin_to_rrule (stream->value, comp, detached_components, recur_zone);
}
}
- b = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidReminderSet);
+ b = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidReminderSet);
if (b && *b) {
struct timeval start, displaytime;
- if ((exchange_mapi_util_find_array_datetime_namedid (&start, properties, conn, fid, PidLidReminderTime) == MAPI_E_SUCCESS)
- && (exchange_mapi_util_find_array_datetime_namedid (&displaytime, properties, conn, fid, PidLidReminderSignalTime) == MAPI_E_SUCCESS)) {
+ if ((e_mapi_util_find_array_datetime_namedid (&start, properties, conn, fid, PidLidReminderTime) == MAPI_E_SUCCESS)
+ && (e_mapi_util_find_array_datetime_namedid (&displaytime, properties, conn, fid, PidLidReminderSignalTime) == MAPI_E_SUCCESS)) {
ECalComponentAlarm *e_alarm = e_cal_component_alarm_new ();
ECalComponentAlarmTrigger trigger;
@@ -1005,38 +1005,38 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
const uint64_t *status = NULL;
/* NOTE: Exchange tasks are DATE values, not DATE-TIME values, but maybe someday, we could expect Exchange to support it;) */
- if (exchange_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidTaskStartDate) == MAPI_E_SUCCESS)
+ if (e_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidTaskStartDate) == MAPI_E_SUCCESS)
icalcomponent_set_dtstart (ical_comp, icaltime_from_timet_with_zone (t.tv_sec, 1, default_zone));
- if (exchange_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidTaskDueDate) == MAPI_E_SUCCESS)
+ if (e_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidTaskDueDate) == MAPI_E_SUCCESS)
icalcomponent_set_due (ical_comp, icaltime_from_timet_with_zone (t.tv_sec, 1, default_zone));
- status = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidTaskStatus);
+ status = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidTaskStatus);
if (status) {
icalcomponent_set_status (ical_comp, get_taskstatus_from_prop(*status));
if (*status == olTaskComplete
- && exchange_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidTaskDateCompleted) == MAPI_E_SUCCESS) {
+ && e_mapi_util_find_array_datetime_namedid (&t, properties, conn, fid, PidLidTaskDateCompleted) == MAPI_E_SUCCESS) {
prop = icalproperty_new_completed (icaltime_from_timet_with_zone (t.tv_sec, 1, default_zone));
icalcomponent_add_property (ical_comp, prop);
}
}
- complete = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidPercentComplete);
+ complete = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidPercentComplete);
if (complete) {
prop = icalproperty_new_percentcomplete ((gint)(*complete * 100 + 1e-9));
icalcomponent_add_property (ical_comp, prop);
}
- b = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidTaskFRecurring);
+ b = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidTaskFRecurring);
if (b && *b) {
/* FIXME: Evolution does not support recurring tasks */
g_warning ("Encountered a recurring task.");
}
- b = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidReminderSet);
+ b = e_mapi_util_find_array_namedid (properties, conn, fid, PidLidReminderSet);
if (b && *b) {
struct timeval abs;
- if (exchange_mapi_util_find_array_datetime_namedid (&abs, properties, conn, fid, PidLidReminderTime) == MAPI_E_SUCCESS) {
+ if (e_mapi_util_find_array_datetime_namedid (&abs, properties, conn, fid, PidLidReminderTime) == MAPI_E_SUCCESS) {
ECalComponentAlarm *e_alarm = e_cal_component_alarm_new ();
ECalComponentAlarmTrigger trigger;
@@ -1103,12 +1103,12 @@ fetch_camel_cal_comp_cb (FetchItemsCallbackData *item_data, gpointer data)
if (!comp) {
/* read component from a mail, if not found in the calendar */
if (mid)
- smid = exchange_mapi_util_mapi_id_to_string (mid);
+ smid = e_mapi_util_mapi_id_to_string (mid);
else if (item_data->mid)
- smid = exchange_mapi_util_mapi_id_to_string (item_data->mid);
+ smid = e_mapi_util_mapi_id_to_string (item_data->mid);
else
smid = e_cal_component_gen_uid();
- comp = exchange_mapi_cal_util_mapi_props_to_comp (item_data->conn, item_data->fid, fccd->kind, smid,
+ comp = e_mapi_cal_util_mapi_props_to_comp (item_data->conn, item_data->fid, fccd->kind, smid,
item_data->properties, item_data->streams, item_data->recipients,
item_data->attachments, filepath, NULL, fccd->method == ICAL_METHOD_REPLY,
&detached_recurrences);
@@ -1134,9 +1134,9 @@ fetch_camel_cal_comp_cb (FetchItemsCallbackData *item_data, gpointer data)
g_object_unref (comp);
g_slist_free (detached_recurrences);
- exchange_mapi_util_free_stream_list (&item_data->streams);
- exchange_mapi_util_free_recipient_list (&item_data->recipients);
- exchange_mapi_util_free_attachment_list (&item_data->attachments);
+ e_mapi_util_free_stream_list (&item_data->streams);
+ e_mapi_util_free_recipient_list (&item_data->recipients);
+ e_mapi_util_free_attachment_list (&item_data->attachments);
fccd->result_data = str;
@@ -1144,7 +1144,7 @@ fetch_camel_cal_comp_cb (FetchItemsCallbackData *item_data, gpointer data)
}
gchar *
-exchange_mapi_cal_util_camel_helper (ExchangeMapiConnection *conn, mapi_id_t orig_fid, mapi_id_t orig_mid, mapi_object_t *obj_message, const gchar *msg_class,
+e_mapi_cal_util_camel_helper (EMapiConnection *conn, mapi_id_t orig_fid, mapi_id_t orig_mid, mapi_object_t *obj_message, const gchar *msg_class,
GSList *streams, GSList *recipients, GSList *attachments)
{
struct fetch_camel_cal_data fccd = { 0 };
@@ -1168,13 +1168,13 @@ exchange_mapi_cal_util_camel_helper (ExchangeMapiConnection *conn, mapi_id_t ori
return NULL;
if (obj_message)
- exchange_mapi_connection_fetch_object_props (conn, NULL, orig_fid, orig_mid, obj_message,
- exchange_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (fccd.kind),
+ e_mapi_connection_fetch_object_props (conn, NULL, orig_fid, orig_mid, obj_message,
+ e_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (fccd.kind),
fetch_camel_cal_comp_cb, &fccd,
MAPI_OPTIONS_FETCH_ALL, NULL);
else
- exchange_mapi_connection_fetch_item (conn, orig_fid, orig_mid,
- exchange_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (fccd.kind),
+ e_mapi_connection_fetch_item (conn, orig_fid, orig_mid,
+ e_mapi_cal_utils_get_props_cb, GINT_TO_POINTER (fccd.kind),
fetch_camel_cal_comp_cb, &fccd,
MAPI_OPTIONS_FETCH_ALL, NULL);
@@ -1183,7 +1183,7 @@ exchange_mapi_cal_util_camel_helper (ExchangeMapiConnection *conn, mapi_id_t ori
/* call with props = NULL to fetch named ids into the connection cache */
gboolean
-exchange_mapi_cal_utils_add_named_ids (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gint pkind)
+e_mapi_cal_utils_add_named_ids (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gint pkind)
{
/* do not make this array static, the function modifies it on run */
ResolveNamedIDsData common_nids[] = {
@@ -1204,9 +1204,9 @@ exchange_mapi_cal_utils_add_named_ids (ExchangeMapiConnection *conn, mapi_id_t f
icalcomponent_kind kind = pkind;
if (!props) {
- if (!exchange_mapi_connection_resolve_named_props (conn, fid, common_nids, G_N_ELEMENTS (common_nids), NULL))
+ if (!e_mapi_connection_resolve_named_props (conn, fid, common_nids, G_N_ELEMENTS (common_nids), NULL))
return FALSE;
- } else if (!exchange_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, common_nids, G_N_ELEMENTS (common_nids)))
+ } else if (!e_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, common_nids, G_N_ELEMENTS (common_nids)))
return FALSE;
if (kind == ICAL_VEVENT_COMPONENT)
@@ -1222,7 +1222,7 @@ exchange_mapi_cal_utils_add_named_ids (ExchangeMapiConnection *conn, mapi_id_t f
#define DEFAULT_APPT_REMINDER_MINS 15
static gboolean
-appt_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props)
+appt_build_name_id (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props)
{
/* do not make this array static, the function modifies it on run */
ResolveNamedIDsData nids[] = {
@@ -1259,15 +1259,15 @@ appt_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem
};
if (!props)
- return exchange_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL);
+ return e_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL);
- return exchange_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
+ return e_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
}
#define DEFAULT_TASK_REMINDER_MINS 1080
static gboolean
-task_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props)
+task_build_name_id (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props)
{
/* do not make this array static, the function modifies it on run */
ResolveNamedIDsData nids[] = {
@@ -1288,13 +1288,13 @@ task_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem
};
if (!props)
- return exchange_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL);
+ return e_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL);
- return exchange_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
+ return e_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
}
static gboolean
-note_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props)
+note_build_name_id (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props)
{
/* do not make this array static, the function modifies it on run */
ResolveNamedIDsData nids[] = {
@@ -1304,9 +1304,9 @@ note_build_name_id (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem
};
if (!props)
- return exchange_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL);
+ return e_mapi_connection_resolve_named_props (conn, fid, nids, G_N_ELEMENTS (nids), NULL);
- return exchange_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
+ return e_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
}
/* retrieves timezone location from a timezone ID */
@@ -1343,7 +1343,7 @@ get_tzid_location (const gchar *tzid, struct cal_cbdata *cbdata)
#define SECS_IN_MINUTE 60
gboolean
-exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data)
+e_mapi_cal_utils_write_props_cb (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data)
{
struct cal_cbdata *cbdata = (struct cal_cbdata *) data;
ECalComponent *comp;
@@ -1369,7 +1369,7 @@ exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t
case ICAL_VEVENT_COMPONENT:
case ICAL_VTODO_COMPONENT:
case ICAL_VJOURNAL_COMPONENT:
- if (!exchange_mapi_cal_utils_add_named_ids (conn, fid, mem_ctx, NULL, cbdata->kind))
+ if (!e_mapi_cal_utils_add_named_ids (conn, fid, mem_ctx, NULL, cbdata->kind))
return FALSE;
break;
default:
@@ -1382,30 +1382,30 @@ exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t
g_return_val_if_fail (kind == cbdata->kind, FALSE);
#define set_value(hex, val) G_STMT_START { \
- if (!exchange_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, val)) \
+ if (!e_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, val)) \
return FALSE; \
} G_STMT_END
#define set_named_value(named_id, val) G_STMT_START { \
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, named_id, val)) \
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, named_id, val)) \
return FALSE; \
} G_STMT_END
#define set_datetime_value(hex, dtval) G_STMT_START { \
struct FILETIME filetime; \
\
- exchange_mapi_util_time_t_to_filetime (dtval, &filetime); \
+ e_mapi_util_time_t_to_filetime (dtval, &filetime); \
\
- if (!exchange_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, &filetime)) \
+ if (!e_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, &filetime)) \
return FALSE; \
} G_STMT_END
#define set_named_datetime_value(named_id, dtval) G_STMT_START { \
struct FILETIME filetime; \
\
- exchange_mapi_util_time_t_to_filetime (dtval, &filetime); \
+ e_mapi_util_time_t_to_filetime (dtval, &filetime); \
\
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, named_id, &filetime)) \
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, named_id, &filetime)) \
return FALSE; \
} G_STMT_END
@@ -1647,9 +1647,9 @@ exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t
set_named_datetime_value (PidLidClipStart, tt);
/* Start TZ */
- mapi_tzid = exchange_mapi_cal_tz_util_get_mapi_equivalent ((dtstart_tz_location && *dtstart_tz_location) ? dtstart_tz_location : "UTC");
+ mapi_tzid = e_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);
+ e_mapi_cal_util_mapi_tz_to_bin (mapi_tzid, &start_tz);
set_named_value (PidLidAppointmentTimeZoneDefinitionStartDisplay, &start_tz);
}
set_named_value (PidLidTimeZoneDescription, mapi_tzid ? mapi_tzid : "");
@@ -1661,9 +1661,9 @@ exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t
set_named_datetime_value (PidLidClipEnd, tt);
/* End TZ */
- mapi_tzid = exchange_mapi_cal_tz_util_get_mapi_equivalent ((dtend_tz_location && *dtend_tz_location) ? dtend_tz_location : "UTC");
+ mapi_tzid = e_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);
+ e_mapi_cal_util_mapi_tz_to_bin (mapi_tzid, &end_tz);
set_named_value (PidLidAppointmentTimeZoneDefinitionEndDisplay, &end_tz);
}
@@ -1678,7 +1678,7 @@ exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t
zone_location = get_tzid_location ("*default-zone*", cbdata);
ictz = icaltimezone_get_builtin_timezone (zone_location);
- pltz = exchange_mapi_cal_util_mapi_tz_pidlidtimezone (ictz);
+ pltz = e_mapi_cal_util_mapi_tz_pidlidtimezone (ictz);
set_named_value (PidLidTimeZone, &pltz);
}
@@ -1714,11 +1714,11 @@ exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t
if (!flag32) {
gchar *propval;
- propval = exchange_mapi_cal_utils_get_icomp_x_prop (e_cal_component_get_icalcomponent (comp), "X-EVOLUTION-MAPI-OWNER-APPT-ID");
+ propval = e_mapi_cal_utils_get_icomp_x_prop (e_cal_component_get_icalcomponent (comp), "X-EVOLUTION-MAPI-OWNER-APPT-ID");
if (propval && *propval) {
mapi_id_t as_id = 0;
- if (exchange_mapi_util_mapi_id_from_string (propval, &as_id))
+ if (e_mapi_util_mapi_id_from_string (propval, &as_id))
flag32 = (uint32_t) as_id;
}
@@ -1999,7 +1999,7 @@ exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t
}
uint32_t
-exchange_mapi_cal_util_get_new_appt_id (ExchangeMapiConnection *conn, mapi_id_t fid)
+e_mapi_cal_util_get_new_appt_id (EMapiConnection *conn, mapi_id_t fid)
{
struct mapi_SRestriction res;
struct SPropValue sprop;
@@ -2020,7 +2020,7 @@ exchange_mapi_cal_util_get_new_appt_id (ExchangeMapiConnection *conn, mapi_id_t
cast_mapi_SPropValue (mem_ctx,
&(res.res.resProperty.lpProp),
&sprop);
- ids = exchange_mapi_connection_check_restriction (conn, fid, 0, &res, NULL);
+ ids = e_mapi_connection_check_restriction (conn, fid, 0, &res, NULL);
if (ids) {
GSList *l;
for (l = ids; l; l = l->next)
@@ -2162,7 +2162,7 @@ populate_freebusy_data (struct Binary_r *bin, uint32_t month, uint32_t year, GSL
}
gboolean
-exchange_mapi_cal_utils_get_free_busy_data (ExchangeMapiConnection *conn, const GSList *users, time_t start, time_t end, GSList **freebusy, GError **mapi_error)
+e_mapi_cal_utils_get_free_busy_data (EMapiConnection *conn, const GSList *users, time_t start, time_t end, GSList **freebusy, GError **mapi_error)
{
struct SRow aRow;
enum MAPISTATUS ms;
@@ -2189,7 +2189,7 @@ exchange_mapi_cal_utils_get_free_busy_data (ExchangeMapiConnection *conn, const
*freebusy = NULL;
- if (!exchange_mapi_connection_get_public_folder (conn, &obj_store, mapi_error)) {
+ if (!e_mapi_connection_get_public_folder (conn, &obj_store, mapi_error)) {
return FALSE;
}
@@ -2275,7 +2275,7 @@ exchange_mapi_cal_utils_get_free_busy_data (ExchangeMapiConnection *conn, const
/* beware, the 'data' pointer is an integer of the event kind */
gboolean
-exchange_mapi_cal_utils_get_props_cb (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
+e_mapi_cal_utils_get_props_cb (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
{
static const uint32_t cal_GetPropsList[] = {
PR_FID,
@@ -2315,14 +2315,14 @@ exchange_mapi_cal_utils_get_props_cb (ExchangeMapiConnection *conn, mapi_id_t fi
g_return_val_if_fail (mem_ctx != NULL, FALSE);
g_return_val_if_fail (props != NULL, FALSE);
- if (!exchange_mapi_utils_add_props_to_props_array (mem_ctx, props, cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList)))
+ if (!e_mapi_utils_add_props_to_props_array (mem_ctx, props, cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList)))
return FALSE;
- return exchange_mapi_cal_utils_add_named_ids (conn, fid, mem_ctx, props, GPOINTER_TO_INT (data));
+ return e_mapi_cal_utils_add_named_ids (conn, fid, mem_ctx, props, GPOINTER_TO_INT (data));
}
gchar *
-exchange_mapi_cal_utils_get_icomp_x_prop (icalcomponent *comp, const gchar *key)
+e_mapi_cal_utils_get_icomp_x_prop (icalcomponent *comp, const gchar *key)
{
icalproperty *xprop;
diff --git a/src/libexchangemapi/exchange-mapi-cal-utils.h b/src/libexchangemapi/e-mapi-cal-utils.h
similarity index 53%
rename from src/libexchangemapi/exchange-mapi-cal-utils.h
rename to src/libexchangemapi/e-mapi-cal-utils.h
index 81515c9..02b39d2 100644
--- a/src/libexchangemapi/exchange-mapi-cal-utils.h
+++ b/src/libexchangemapi/e-mapi-cal-utils.h
@@ -21,17 +21,17 @@
*
*/
-#ifndef EXCHANGE_MAPI_CAL_UTILS_H
-#define EXCHANGE_MAPI_CAL_UTILS_H
+#ifndef E_MAPI_CAL_UTILS_H
+#define E_MAPI_CAL_UTILS_H
#include <libecal/e-cal-component.h>
-#include "exchange-mapi-connection.h"
-#include "exchange-mapi-defs.h"
-#include "exchange-mapi-utils.h"
+#include "e-mapi-connection.h"
+#include "e-mapi-defs.h"
+#include "e-mapi-utils.h"
-#include "exchange-mapi-cal-tz-utils.h"
-#include "exchange-mapi-cal-recur-utils.h"
+#include "e-mapi-cal-tz-utils.h"
+#include "e-mapi-cal-recur-utils.h"
G_BEGIN_DECLS
@@ -76,34 +76,34 @@ struct cal_cbdata {
};
void
-exchange_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list);
+e_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list);
void
-exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_list);
+e_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_list);
void
-exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_list, const gchar *local_store_uri);
+e_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_list, const gchar *local_store_uri);
ECalComponent *
-exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id_t fid, icalcomponent_kind kind, const gchar *mid, struct mapi_SPropValue_array *properties,
+e_mapi_cal_util_mapi_props_to_comp (EMapiConnection *conn, mapi_id_t fid, 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 is_reply, GSList **detached_components);
void
-exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const gchar *uid, const struct timeval *exception_replace_time, const struct FILETIME *creation_time, struct Binary_r *sb);
+e_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const gchar *uid, const struct timeval *exception_replace_time, const struct FILETIME *creation_time, struct Binary_r *sb);
gchar *
-exchange_mapi_cal_util_camel_helper (ExchangeMapiConnection *conn, mapi_id_t fid, mapi_id_t mid, mapi_object_t *obj_message, const gchar *msg_class,
+e_mapi_cal_util_camel_helper (EMapiConnection *conn, mapi_id_t fid, mapi_id_t mid, mapi_object_t *obj_message, const gchar *msg_class,
GSList *streams, GSList *recipients, GSList *attachments);
uint32_t
-exchange_mapi_cal_util_get_new_appt_id (ExchangeMapiConnection *conn, mapi_id_t fid);
+e_mapi_cal_util_get_new_appt_id (EMapiConnection *conn, mapi_id_t fid);
-gboolean exchange_mapi_cal_utils_add_named_ids (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gint pkind);
-gboolean exchange_mapi_cal_utils_get_props_cb (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data);
-gboolean exchange_mapi_cal_utils_write_props_cb (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data);
+gboolean e_mapi_cal_utils_add_named_ids (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gint pkind);
+gboolean e_mapi_cal_utils_get_props_cb (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data);
+gboolean e_mapi_cal_utils_write_props_cb (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data);
-gboolean exchange_mapi_cal_utils_get_free_busy_data (ExchangeMapiConnection *conn, const GSList *users, time_t start, time_t end, GSList **freebusy, GError **mapi_error);
+gboolean e_mapi_cal_utils_get_free_busy_data (EMapiConnection *conn, const GSList *users, time_t start, time_t end, GSList **freebusy, GError **mapi_error);
-gchar *exchange_mapi_cal_utils_get_icomp_x_prop (icalcomponent *comp, const gchar *key);
+gchar *e_mapi_cal_utils_get_icomp_x_prop (icalcomponent *comp, const gchar *key);
G_END_DECLS
diff --git a/src/libexchangemapi/exchange-mapi-connection.c b/src/libexchangemapi/e-mapi-connection.c
similarity index 80%
rename from src/libexchangemapi/exchange-mapi-connection.c
rename to src/libexchangemapi/e-mapi-connection.c
index 416a73d..7216601 100644
--- a/src/libexchangemapi/exchange-mapi-connection.c
+++ b/src/libexchangemapi/e-mapi-connection.c
@@ -33,29 +33,29 @@
#include <libedataserver/e-data-server-util.h>
#include <libedataserver/e-flag.h>
-#include "exchange-mapi-connection.h"
-#include "exchange-mapi-folder.h"
-#include "exchange-mapi-utils.h"
-#include "exchange-mapi-mail-utils.h"
+#include "e-mapi-connection.h"
+#include "e-mapi-folder.h"
+#include "e-mapi-utils.h"
+#include "e-mapi-mail-utils.h"
#include "e-mapi-fast-transfer.h"
#include <param.h>
#define DEFAULT_PROF_NAME "mapi-profiles.ldb"
-static void register_connection (ExchangeMapiConnection *conn);
-static void unregister_connection (ExchangeMapiConnection *conn);
-static gboolean mapi_profile_create (const ExchangeMapiProfileData *empd, mapi_profile_callback_t callback, gconstpointer data, GError **perror, gboolean use_locking);
+static void register_connection (EMapiConnection *conn);
+static void unregister_connection (EMapiConnection *conn);
+static gboolean mapi_profile_create (const EMapiProfileData *empd, mapi_profile_callback_t callback, gconstpointer data, GError **perror, gboolean use_locking);
static struct mapi_session *mapi_profile_load (const gchar *profname, const gchar *password, GError **perror);
static void ema_global_lock (void);
static void ema_global_unlock (void);
/* GObject foo - begin */
-G_DEFINE_TYPE (ExchangeMapiConnection, exchange_mapi_connection, G_TYPE_OBJECT)
+G_DEFINE_TYPE (EMapiConnection, e_mapi_connection, G_TYPE_OBJECT)
-/* These two macros require 'priv' variable of type ExchangeMapiConnectionPrivate */
-#define LOCK() exchange_mapi_debug_print ("%s: %s: lock(session/global_lock)", G_STRLOC, G_STRFUNC); g_static_rec_mutex_lock (&priv->session_lock); ema_global_lock();
-#define UNLOCK() exchange_mapi_debug_print ("%s: %s: unlock(session/global_lock)", G_STRLOC, G_STRFUNC); g_static_rec_mutex_unlock (&priv->session_lock); ema_global_unlock();
+/* These two macros require 'priv' variable of type EMapiConnectionPrivate */
+#define LOCK() e_mapi_debug_print ("%s: %s: lock(session/global_lock)", G_STRLOC, G_STRFUNC); g_static_rec_mutex_lock (&priv->session_lock); ema_global_lock();
+#define UNLOCK() e_mapi_debug_print ("%s: %s: unlock(session/global_lock)", G_STRLOC, G_STRFUNC); g_static_rec_mutex_unlock (&priv->session_lock); ema_global_unlock();
#define e_return_val_mapi_error_if_fail(expr, _code, _val) \
G_STMT_START { \
@@ -144,7 +144,7 @@ make_mapi_error (GError **perror, const gchar *context, enum MAPISTATUS mapi_sta
struct mapi_context *mapi_ctx = NULL;
-struct _ExchangeMapiConnectionPrivate {
+struct _EMapiConnectionPrivate {
struct mapi_session *session;
GStaticRecMutex session_lock;
@@ -163,7 +163,7 @@ struct _ExchangeMapiConnectionPrivate {
/* should have session_lock locked already, when calling this function */
static void
-disconnect (ExchangeMapiConnectionPrivate *priv)
+disconnect (EMapiConnectionPrivate *priv)
{
g_return_if_fail (priv != NULL);
@@ -172,7 +172,7 @@ disconnect (ExchangeMapiConnectionPrivate *priv)
g_static_rec_mutex_lock (&priv->folders_lock);
if (priv->folders)
- exchange_mapi_folder_free_list (priv->folders);
+ e_mapi_folder_free_list (priv->folders);
priv->folders = NULL;
g_static_rec_mutex_unlock (&priv->folders_lock);
@@ -191,7 +191,7 @@ disconnect (ExchangeMapiConnectionPrivate *priv)
/* should have session_lock locked already, when calling this function */
static gboolean
-ensure_public_store (ExchangeMapiConnectionPrivate *priv, GError **perror)
+ensure_public_store (EMapiConnectionPrivate *priv, GError **perror)
{
e_return_val_mapi_error_if_fail (priv != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
@@ -215,13 +215,13 @@ ensure_public_store (ExchangeMapiConnectionPrivate *priv, GError **perror)
}
static void
-exchange_mapi_connection_finalize (GObject *object)
+e_mapi_connection_finalize (GObject *object)
{
- ExchangeMapiConnectionPrivate *priv;
+ EMapiConnectionPrivate *priv;
- unregister_connection (EXCHANGE_MAPI_CONNECTION (object));
+ unregister_connection (E_MAPI_CONNECTION (object));
- priv = EXCHANGE_MAPI_CONNECTION (object)->priv;
+ priv = E_MAPI_CONNECTION (object)->priv;
if (priv) {
LOCK ();
@@ -238,25 +238,25 @@ exchange_mapi_connection_finalize (GObject *object)
g_static_rec_mutex_free (&priv->folders_lock);
}
- if (G_OBJECT_CLASS (exchange_mapi_connection_parent_class)->finalize)
- G_OBJECT_CLASS (exchange_mapi_connection_parent_class)->finalize (object);
+ if (G_OBJECT_CLASS (e_mapi_connection_parent_class)->finalize)
+ G_OBJECT_CLASS (e_mapi_connection_parent_class)->finalize (object);
}
static void
-exchange_mapi_connection_class_init (ExchangeMapiConnectionClass *klass)
+e_mapi_connection_class_init (EMapiConnectionClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (ExchangeMapiConnectionPrivate));
+ g_type_class_add_private (klass, sizeof (EMapiConnectionPrivate));
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = exchange_mapi_connection_finalize;
+ object_class->finalize = e_mapi_connection_finalize;
}
static void
-exchange_mapi_connection_init (ExchangeMapiConnection *conn)
+e_mapi_connection_init (EMapiConnection *conn)
{
- conn->priv = G_TYPE_INSTANCE_GET_PRIVATE (conn, EXCHANGE_TYPE_MAPI_CONNECTION, ExchangeMapiConnectionPrivate);
+ conn->priv = G_TYPE_INSTANCE_GET_PRIVATE (conn, E_MAPI_TYPE_CONNECTION, EMapiConnectionPrivate);
g_return_if_fail (conn->priv != NULL);
g_static_rec_mutex_init (&conn->priv->session_lock);
@@ -280,22 +280,22 @@ static GSList *known_connections = NULL;
G_LOCK_DEFINE_STATIC (known_connections);
static void
-register_connection (ExchangeMapiConnection *conn)
+register_connection (EMapiConnection *conn)
{
g_return_if_fail (conn != NULL);
- g_return_if_fail (EXCHANGE_IS_MAPI_CONNECTION (conn));
+ g_return_if_fail (E_MAPI_IS_CONNECTION (conn));
G_LOCK (known_connections);
- /* append to prefer older connections when searching with exchange_mapi_connection_find() */
+ /* append to prefer older connections when searching with e_mapi_connection_find() */
known_connections = g_slist_append (known_connections, conn);
G_UNLOCK (known_connections);
}
static void
-unregister_connection (ExchangeMapiConnection *conn)
+unregister_connection (EMapiConnection *conn)
{
g_return_if_fail (conn != NULL);
- g_return_if_fail (EXCHANGE_IS_MAPI_CONNECTION (conn));
+ g_return_if_fail (E_MAPI_IS_CONNECTION (conn));
G_LOCK (known_connections);
if (!g_slist_find (known_connections, conn)) {
@@ -312,18 +312,18 @@ unregister_connection (ExchangeMapiConnection *conn)
Note if it doesn't return NULL, then the returned pointer
should be g_object_unref-ed, when done with it.
*/
-ExchangeMapiConnection *
-exchange_mapi_connection_find (const gchar *profile)
+EMapiConnection *
+e_mapi_connection_find (const gchar *profile)
{
GSList *l;
- ExchangeMapiConnection *res = NULL;
+ EMapiConnection *res = NULL;
g_return_val_if_fail (profile != NULL, NULL);
G_LOCK (known_connections);
for (l = known_connections; l != NULL && res == NULL; l = l->next) {
- ExchangeMapiConnection *conn = EXCHANGE_MAPI_CONNECTION (l->data);
- ExchangeMapiConnectionPrivate *priv = conn->priv;
+ EMapiConnection *conn = E_MAPI_CONNECTION (l->data);
+ EMapiConnectionPrivate *priv = conn->priv;
if (priv && priv->profile && g_str_equal (profile, priv->profile))
res = conn;
@@ -347,21 +347,21 @@ exchange_mapi_connection_find (const gchar *profile)
#define STREAM_ACCESS_WRITE 0x0001
#define STREAM_ACCESS_READWRITE 0x0002
-#define CHECK_CORRECT_CONN_AND_GET_PRIV(_conn, _val) \
- ExchangeMapiConnectionPrivate *priv; \
- \
- e_return_val_mapi_error_if_fail (_conn != NULL, MAPI_E_INVALID_PARAMETER, _val); \
- e_return_val_mapi_error_if_fail (EXCHANGE_IS_MAPI_CONNECTION (_conn), MAPI_E_INVALID_PARAMETER, _val); \
- \
- priv = (_conn)->priv; \
+#define CHECK_CORRECT_CONN_AND_GET_PRIV(_conn, _val) \
+ EMapiConnectionPrivate *priv; \
+ \
+ e_return_val_mapi_error_if_fail (_conn != NULL, MAPI_E_INVALID_PARAMETER, _val); \
+ e_return_val_mapi_error_if_fail (E_MAPI_IS_CONNECTION (_conn), MAPI_E_INVALID_PARAMETER, _val); \
+ \
+ priv = (_conn)->priv; \
e_return_val_mapi_error_if_fail (priv != NULL, MAPI_E_INVALID_PARAMETER, _val);
/* Creates a new connection object and connects to a server as defined in 'profile' */
-ExchangeMapiConnection *
-exchange_mapi_connection_new (const gchar *profile, const gchar *password, GError **perror)
+EMapiConnection *
+e_mapi_connection_new (const gchar *profile, const gchar *password, GError **perror)
{
- ExchangeMapiConnection *conn;
- ExchangeMapiConnectionPrivate *priv;
+ EMapiConnection *conn;
+ EMapiConnectionPrivate *priv;
struct mapi_session *session;
enum MAPISTATUS ms;
@@ -369,11 +369,11 @@ exchange_mapi_connection_new (const gchar *profile, const gchar *password, GErro
session = mapi_profile_load (profile, password, perror);
if (!session) {
- exchange_mapi_debug_print ("%s: %s: Login failed ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: %s: Login failed ", G_STRLOC, G_STRFUNC);
return NULL;
}
- conn = g_object_new (EXCHANGE_TYPE_MAPI_CONNECTION, NULL);
+ conn = g_object_new (E_MAPI_TYPE_CONNECTION, NULL);
priv = conn->priv;
e_return_val_mapi_error_if_fail (priv != NULL, MAPI_E_INVALID_PARAMETER, conn);
@@ -398,13 +398,13 @@ exchange_mapi_connection_new (const gchar *profile, const gchar *password, GErro
priv->has_public_store = FALSE;
UNLOCK ();
- exchange_mapi_debug_print ("%s: %s: Connected ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: %s: Connected ", G_STRLOC, G_STRFUNC);
return conn;
}
gboolean
-exchange_mapi_connection_close (ExchangeMapiConnection *conn)
+e_mapi_connection_close (EMapiConnection *conn)
{
gboolean res = FALSE;
/* to have this used in the below macros */
@@ -423,7 +423,7 @@ exchange_mapi_connection_close (ExchangeMapiConnection *conn)
}
gboolean
-exchange_mapi_connection_reconnect (ExchangeMapiConnection *conn, const gchar *password, GError **perror)
+e_mapi_connection_reconnect (EMapiConnection *conn, const gchar *password, GError **perror)
{
enum MAPISTATUS ms;
@@ -433,11 +433,11 @@ exchange_mapi_connection_reconnect (ExchangeMapiConnection *conn, const gchar *p
LOCK ();
if (priv->session)
- exchange_mapi_connection_close (conn);
+ e_mapi_connection_close (conn);
priv->session = mapi_profile_load (priv->profile, password, perror);
if (!priv->session) {
- exchange_mapi_debug_print ("%s: %s: Login failed ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: %s: Login failed ", G_STRLOC, G_STRFUNC);
UNLOCK ();
return FALSE;
}
@@ -460,13 +460,13 @@ exchange_mapi_connection_reconnect (ExchangeMapiConnection *conn, const gchar *p
UNLOCK ();
- exchange_mapi_debug_print ("%s: %s: Connected ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: %s: Connected ", G_STRLOC, G_STRFUNC);
return priv->session != NULL;
}
gboolean
-exchange_mapi_connection_connected (ExchangeMapiConnection *conn)
+e_mapi_connection_connected (EMapiConnection *conn)
{
/* to have this used in the below macros */
GError **perror = NULL;
@@ -514,12 +514,12 @@ set_stream_value (ExchangeMAPIStream *stream, const uint32_t *cpid, const guint8
static gboolean
add_stream_from_properties (GSList **stream_list, struct mapi_SPropValue_array *properties, uint32_t proptag, const uint32_t *cpid)
{
- if (exchange_mapi_util_find_stream (*stream_list, proptag)) {
+ if (e_mapi_util_find_stream (*stream_list, proptag)) {
return TRUE;
} else if (properties) {
gconstpointer data;
- data = exchange_mapi_util_find_array_propval (properties, proptag);
+ data = e_mapi_util_find_array_propval (properties, proptag);
if (data) {
const struct SBinary_short *bin;
const gchar *str;
@@ -557,7 +557,7 @@ add_stream_from_properties (GSList **stream_list, struct mapi_SPropValue_array *
}
static gboolean
-exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, const uint32_t *cpid, uint32_t proptag, GSList **stream_list, struct mapi_SPropValue_array *properties, GError **perror)
+e_mapi_util_read_generic_stream (mapi_object_t *obj_message, const uint32_t *cpid, uint32_t proptag, GSList **stream_list, struct mapi_SPropValue_array *properties, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -579,8 +579,8 @@ exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, const uint32
if (add_stream_from_properties (stream_list, properties, proptag, cpid))
return TRUE;
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
- exchange_mapi_debug_print("Attempt to read stream for proptag 0x%08X ", proptag);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("Attempt to read stream for proptag 0x%08X ", proptag);
mem_ctx = talloc_init ("ExchangeMAPI_ReadGenericStream");
mapi_object_init(&obj_stream);
@@ -649,7 +649,7 @@ exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, const uint32
stream->proptag = proptag;
set_stream_value (stream, cpid, buf_data, off_data, FALSE);
- exchange_mapi_debug_print("Attempt succeeded for proptag 0x%08X (after name conversion) ", stream->proptag);
+ e_mapi_debug_print("Attempt succeeded for proptag 0x%08X (after name conversion) ", stream->proptag);
*stream_list = g_slist_append (*stream_list, stream);
}
@@ -658,15 +658,15 @@ cleanup:
mapi_object_release(&obj_stream);
talloc_free (mem_ctx);
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return (ms == MAPI_E_SUCCESS);
}
static void
-exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream_list, struct mapi_SPropValue_array *properties, gboolean by_best_body)
+e_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream_list, struct mapi_SPropValue_array *properties, gboolean by_best_body)
{
- const uint32_t *cpid = exchange_mapi_util_find_array_propval (properties, PR_INTERNET_CPID);
+ const uint32_t *cpid = e_mapi_util_find_array_propval (properties, PR_INTERNET_CPID);
gboolean can_html = FALSE, has_body = FALSE, has_body_unicode;
has_body_unicode = add_stream_from_properties (stream_list, properties, PR_BODY_UNICODE, cpid);
@@ -678,29 +678,29 @@ exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream
can_html = GetBestBody (obj_message, &best_body) == MAPI_E_SUCCESS && best_body == olEditorHTML;
} else {
- const uint32_t *ui32 = exchange_mapi_util_find_array_propval (properties, PR_MSG_EDITOR_FORMAT);
+ const uint32_t *ui32 = e_mapi_util_find_array_propval (properties, PR_MSG_EDITOR_FORMAT);
can_html = ui32 && *ui32 == olEditorHTML;
}
if (can_html)
- exchange_mapi_util_read_generic_stream (obj_message, cpid, PR_HTML, stream_list, properties, NULL);
+ e_mapi_util_read_generic_stream (obj_message, cpid, PR_HTML, stream_list, properties, NULL);
if (!has_body_unicode)
- has_body_unicode = exchange_mapi_util_read_generic_stream (obj_message, cpid, PR_BODY_UNICODE, stream_list, properties, NULL);
+ has_body_unicode = e_mapi_util_read_generic_stream (obj_message, cpid, PR_BODY_UNICODE, stream_list, properties, NULL);
if (!has_body && !has_body_unicode)
- exchange_mapi_util_read_generic_stream (obj_message, cpid, PR_BODY, stream_list, properties, NULL);
+ e_mapi_util_read_generic_stream (obj_message, cpid, PR_BODY, stream_list, properties, NULL);
}
/* 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, GError **perror)
+e_mapi_util_write_generic_streams (mapi_object_t *obj_message, GSList *stream_list, GError **perror)
{
GSList *l;
enum MAPISTATUS ms;
gboolean status = TRUE;
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
for (l = stream_list; l; l = l->next) {
ExchangeMAPIStream *stream = (ExchangeMAPIStream *) (l->data);
@@ -761,7 +761,7 @@ exchange_mapi_util_write_generic_streams (mapi_object_t *obj_message, GSList *st
mapi_object_release(&obj_stream);
}
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return status;
}
@@ -779,11 +779,11 @@ set_recipient_properties (TALLOC_CTX *mem_ctx, struct SRow *aRow, ExchangeMAPIRe
struct SPropValue sprop;
const gchar *dn = NULL, *email = NULL;
- dn = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval (recipient->in.ext_lpProps, PR_DISPLAY_NAME_UNICODE);
+ dn = (const gchar *) e_mapi_util_find_SPropVal_array_propval (recipient->in.ext_lpProps, PR_DISPLAY_NAME_UNICODE);
dn = (dn) ? dn : "";
- email = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval (recipient->in.ext_lpProps, PR_SMTP_ADDRESS_UNICODE);
+ email = (const gchar *) e_mapi_util_find_SPropVal_array_propval (recipient->in.ext_lpProps, PR_SMTP_ADDRESS_UNICODE);
email = (email) ? email : "";
- exchange_mapi_util_recip_entryid_generate_smtp (mem_ctx, &oneoff_eid, dn, email);
+ e_mapi_util_recip_entryid_generate_smtp (mem_ctx, &oneoff_eid, dn, email);
set_SPropValue_proptag (&sprop, PR_ENTRYID, (gconstpointer )(oneoff_eid));
SRow_addprop (aRow, sprop);
#endif
@@ -800,7 +800,7 @@ set_recipient_properties (TALLOC_CTX *mem_ctx, struct SRow *aRow, ExchangeMAPIRe
}
static gboolean
-exchange_mapi_util_modify_recipients (ExchangeMapiConnection *conn, TALLOC_CTX *mem_ctx, mapi_object_t *obj_message , GSList *recipients, gboolean remove_existing, GError **perror)
+e_mapi_util_modify_recipients (EMapiConnection *conn, TALLOC_CTX *mem_ctx, mapi_object_t *obj_message , GSList *recipients, gboolean remove_existing, GError **perror)
{
enum MAPISTATUS ms;
struct SPropTagArray *SPropTagArray = NULL;
@@ -813,7 +813,7 @@ exchange_mapi_util_modify_recipients (ExchangeMapiConnection *conn, TALLOC_CTX *
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
SPropTagArray = set_SPropTagArray(mem_ctx, 0xA,
PR_ENTRYID,
@@ -856,7 +856,7 @@ exchange_mapi_util_modify_recipients (ExchangeMapiConnection *conn, TALLOC_CTX *
if (FlagList->aulPropTag[i] == MAPI_AMBIGUOUS) {
/* 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 :-( */
- exchange_mapi_debug_print ("%s: %s() - '%s' is ambiguous ", G_STRLOC, G_STRFUNC, recipient->email_id);
+ e_mapi_debug_print ("%s: %s() - '%s' is ambiguous ", G_STRLOC, G_STRFUNC, recipient->email_id);
ms = MAPI_E_AMBIGUOUS_RECIP;
/* Translators: %s is replaced with an email address which was found ambiguous on a remote server */
g_set_error (perror, E_MAPI_ERROR, ms, _("Recipient '%s' is ambiguous"), recipient->email_id);
@@ -893,13 +893,13 @@ exchange_mapi_util_modify_recipients (ExchangeMapiConnection *conn, TALLOC_CTX *
cleanup:
g_free (users);
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return ms == MAPI_E_SUCCESS;
}
static gboolean
-exchange_mapi_util_delete_attachments (mapi_object_t *obj_message, GError **perror)
+e_mapi_util_delete_attachments (mapi_object_t *obj_message, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -910,7 +910,7 @@ exchange_mapi_util_delete_attachments (mapi_object_t *obj_message, GError **perr
uint32_t i_row_attach;
gboolean status = TRUE;
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
mem_ctx = talloc_init ("ExchangeMAPI_DeleteAttachments");
@@ -969,23 +969,23 @@ cleanup:
mapi_object_release(&obj_tb_attach);
talloc_free (mem_ctx);
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return status;
}
/* Returns TRUE if all attachments were written succcesfully, else returns FALSE */
static gboolean
-exchange_mapi_util_set_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, mapi_object_t *obj_message, GSList *attach_list, gboolean remove_existing, GError **perror)
+e_mapi_util_set_attachments (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, mapi_object_t *obj_message, GSList *attach_list, gboolean remove_existing, GError **perror)
{
GSList *l;
enum MAPISTATUS ms;
gboolean status = FALSE;
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
if (remove_existing)
- exchange_mapi_util_delete_attachments (obj_message, NULL);
+ e_mapi_util_delete_attachments (obj_message, NULL);
for (l = attach_list; l; l = l->next) {
ExchangeMAPIAttachment *attachment = (ExchangeMAPIAttachment *) (l->data);
@@ -1007,12 +1007,12 @@ exchange_mapi_util_set_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
mapi_object_t obj_emb_msg;
ui32 = ATTACH_EMBEDDED_MSG;
- exchange_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_ATTACH_METHOD, &ui32);
+ e_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_ATTACH_METHOD, &ui32);
ui32 = 0;
- exchange_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_RENDERING_POSITION, &ui32);
- exchange_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_ATTACH_MIME_TAG, "message/rfc822");
+ e_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_RENDERING_POSITION, &ui32);
+ e_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_ATTACH_MIME_TAG, "message/rfc822");
if (item->header.subject)
- exchange_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_ATTACH_FILENAME_UNICODE, item->header.subject);
+ e_mapi_utils_add_spropvalue (mem_ctx, &props, &propslen, PR_ATTACH_FILENAME_UNICODE, item->header.subject);
/* set properties for the item */
ms = SetProps (&obj_attach, MAPI_PROPS_SKIP_NAMEDID_CHECK, props, propslen);
@@ -1046,7 +1046,7 @@ exchange_mapi_util_set_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
}
if (item->generic_streams) {
- if (!exchange_mapi_util_write_generic_streams (&obj_emb_msg, item->generic_streams, perror)) {
+ if (!e_mapi_util_write_generic_streams (&obj_emb_msg, item->generic_streams, perror)) {
mapi_object_release (&obj_emb_msg);
goto cleanup;
}
@@ -1054,7 +1054,7 @@ exchange_mapi_util_set_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
/* Set attachments if any */
if (item->attachments) {
- if (!exchange_mapi_util_set_attachments (conn, fid, mem_ctx, &obj_emb_msg, item->attachments, FALSE, perror)) {
+ if (!e_mapi_util_set_attachments (conn, fid, mem_ctx, &obj_emb_msg, item->attachments, FALSE, perror)) {
mapi_object_release (&obj_emb_msg);
goto cleanup;
}
@@ -1062,7 +1062,7 @@ exchange_mapi_util_set_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
/* Set recipients if any */
if (item->recipients) {
- if (!exchange_mapi_util_modify_recipients (conn, mem_ctx, &obj_emb_msg, item->recipients, FALSE, perror)) {
+ if (!e_mapi_util_modify_recipients (conn, mem_ctx, &obj_emb_msg, item->recipients, FALSE, perror)) {
mapi_object_release (&obj_emb_msg);
goto cleanup;
}
@@ -1085,7 +1085,7 @@ exchange_mapi_util_set_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
}
/* If there are any streams to be set, write them. */
- if (!exchange_mapi_util_write_generic_streams (&obj_attach, attachment->streams, perror))
+ if (!e_mapi_util_write_generic_streams (&obj_attach, attachment->streams, perror))
goto cleanup;
}
@@ -1102,13 +1102,13 @@ exchange_mapi_util_set_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
mapi_object_release(&obj_attach);
}
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return status;
}
static GByteArray *
-obj_message_to_camel_mime (ExchangeMapiConnection *conn, mapi_id_t fid, mapi_object_t *obj_msg)
+obj_message_to_camel_mime (EMapiConnection *conn, mapi_id_t fid, mapi_object_t *obj_msg)
{
GByteArray *res = NULL;
MailItem *item = NULL;
@@ -1117,7 +1117,7 @@ obj_message_to_camel_mime (ExchangeMapiConnection *conn, mapi_id_t fid, mapi_obj
g_return_val_if_fail (conn != NULL, NULL);
g_return_val_if_fail (obj_msg != NULL, NULL);
- if (!exchange_mapi_connection_fetch_object_props (conn, NULL, fid, 0, obj_msg, mapi_mail_get_item_prop_list, NULL,
+ if (!e_mapi_connection_fetch_object_props (conn, NULL, fid, 0, obj_msg, mapi_mail_get_item_prop_list, NULL,
fetch_props_to_mail_item_cb, &item,
MAPI_OPTIONS_FETCH_ALL | MAPI_OPTIONS_GETBESTBODY, NULL)
|| item == NULL) {
@@ -1181,7 +1181,7 @@ may_skip_property (uint32_t proptag)
/* Returns TRUE if all attachments were read succcesfully, else returns FALSE */
static gboolean
-exchange_mapi_util_get_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, mapi_object_t *obj_message, GSList **attach_list, GError **perror)
+e_mapi_util_get_attachments (EMapiConnection *conn, mapi_id_t fid, mapi_object_t *obj_message, GSList **attach_list, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -1192,7 +1192,7 @@ exchange_mapi_util_get_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
uint32_t i_row_attach;
gboolean status = TRUE;
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
mem_ctx = talloc_init ("ExchangeMAPI_GetAttachments");
@@ -1290,13 +1290,13 @@ exchange_mapi_util_get_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
/* just to get all the other streams */
for (z = 0; z < properties.cValues; z++) {
if ((properties.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY) {
- exchange_mapi_util_read_generic_stream (&obj_attach, exchange_mapi_util_find_array_propval (&properties, PR_INTERNET_CPID), properties.lpProps[z].ulPropTag, &(attachment->streams), &properties, NULL);
+ e_mapi_util_read_generic_stream (&obj_attach, e_mapi_util_find_array_propval (&properties, PR_INTERNET_CPID), properties.lpProps[z].ulPropTag, &(attachment->streams), &properties, NULL);
}
}
ui32 = (const uint32_t *) get_SPropValue_SRow_data(&rows_attach.aRow[i_row_attach], PR_ATTACH_METHOD);
if (ui32 && *ui32 == ATTACH_BY_VALUE) {
- exchange_mapi_util_read_generic_stream (&obj_attach, exchange_mapi_util_find_array_propval (&properties, PR_INTERNET_CPID), PR_ATTACH_DATA_BIN, &(attachment->streams), &properties, NULL);
+ e_mapi_util_read_generic_stream (&obj_attach, e_mapi_util_find_array_propval (&properties, PR_INTERNET_CPID), PR_ATTACH_DATA_BIN, &(attachment->streams), &properties, NULL);
} else if (ui32 && *ui32 == ATTACH_EMBEDDED_MSG) {
mapi_object_t obj_emb_msg;
@@ -1334,13 +1334,13 @@ cleanup:
mapi_object_release(&obj_tb_attach);
talloc_free (mem_ctx);
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return status;
}
gboolean
-exchange_mapi_connection_fetch_gal (ExchangeMapiConnection *conn, struct mapi_SRestriction *restrictions, BuildReadPropsCB build_props, gpointer brp_data, FetchGALCallback cb, gpointer data, GError **perror)
+e_mapi_connection_fetch_gal (EMapiConnection *conn, struct mapi_SRestriction *restrictions, BuildReadPropsCB build_props, gpointer brp_data, FetchGALCallback cb, gpointer data, GError **perror)
{
struct SPropTagArray *propsTagArray;
struct SRowSet *aRowSet;
@@ -1410,7 +1410,7 @@ exchange_mapi_connection_fetch_gal (ExchangeMapiConnection *conn, struct mapi_SR
}
gboolean
-exchange_mapi_connection_get_public_folder (ExchangeMapiConnection *conn, mapi_object_t *obj_store, GError **perror)
+e_mapi_connection_get_public_folder (EMapiConnection *conn, mapi_object_t *obj_store, GError **perror)
{
enum MAPISTATUS ms;
@@ -1435,7 +1435,7 @@ exchange_mapi_connection_get_public_folder (ExchangeMapiConnection *conn, mapi_o
/* Returns TRUE if all recipients were read succcesfully, else returns FALSE */
static gboolean
-exchange_mapi_util_get_recipients (ExchangeMapiConnection *conn, mapi_object_t *obj_message, GSList **recip_list, GError **perror)
+e_mapi_util_get_recipients (EMapiConnection *conn, mapi_object_t *obj_message, GSList **recip_list, GError **perror)
{
enum MAPISTATUS ms;
struct SPropTagArray proptags;
@@ -1443,7 +1443,7 @@ exchange_mapi_util_get_recipients (ExchangeMapiConnection *conn, mapi_object_t *
uint32_t i_row_recip;
gboolean status = TRUE;
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
/* fetch recipient table */
ms = GetRecipientTable (obj_message, &rows_recip, &proptags);
@@ -1459,13 +1459,13 @@ exchange_mapi_util_get_recipients (ExchangeMapiConnection *conn, mapi_object_t *
recipient->mem_ctx = talloc_init ("ExchangeMAPI_GetRecipients");
- entryid = exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_RECIPIENT_ENTRYID);
- if (entryid && exchange_mapi_util_recip_entryid_decode (conn, entryid, &display_name, &email) && email) {
+ entryid = e_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_RECIPIENT_ENTRYID);
+ if (entryid && e_mapi_util_recip_entryid_decode (conn, entryid, &display_name, &email) && email) {
recipient->email_id = talloc_strdup (recipient->mem_ctx, email);
if (display_name)
recipient->display_name = talloc_strdup (recipient->mem_ctx, display_name);
} else {
- 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_UNICODE));
+ recipient->email_id = talloc_steal (recipient->mem_ctx, (const gchar *) e_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_SMTP_ADDRESS_UNICODE));
/* fallback */
if (!recipient->email_id) {
uint32_t fallback_props[] = {
@@ -1473,21 +1473,21 @@ exchange_mapi_util_get_recipients (ExchangeMapiConnection *conn, mapi_object_t *
PR_RECIPIENT_DISPLAY_NAME_UNICODE
};
gint ii;
- const gchar *addrtype = exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_ADDRTYPE_UNICODE);
+ const gchar *addrtype = e_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_ADDRTYPE_UNICODE);
if (addrtype && !g_ascii_strcasecmp (addrtype, "SMTP"))
- 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_UNICODE));
+ recipient->email_id = talloc_steal (recipient->mem_ctx, (const gchar *) e_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_EMAIL_ADDRESS_UNICODE));
for (ii = 0; !recipient->email_id && ii < G_N_ELEMENTS (fallback_props); ii++) {
- recipient->email_id = talloc_steal (recipient->mem_ctx, (const gchar *) exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), fallback_props[ii]));
+ recipient->email_id = talloc_steal (recipient->mem_ctx, (const gchar *) e_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), fallback_props[ii]));
}
}
if (recipient->email_id) {
- const gchar *addrtype = exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_ADDRTYPE_UNICODE);
+ const gchar *addrtype = e_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_ADDRTYPE_UNICODE);
if (addrtype && g_ascii_strcasecmp (addrtype, "EX") == 0)
- recipient->email_id = talloc_strdup (recipient->mem_ctx, exchange_mapi_connection_ex_to_smtp (conn, recipient->email_id, NULL, NULL));
+ recipient->email_id = talloc_strdup (recipient->mem_ctx, e_mapi_connection_ex_to_smtp (conn, recipient->email_id, NULL, NULL));
}
}
@@ -1505,13 +1505,13 @@ cleanup:
if (ms != MAPI_E_SUCCESS)
status = FALSE;
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return status;
}
static enum MAPISTATUS
-open_folder (ExchangeMapiConnection *conn, uint32_t olFolder, mapi_id_t *fid, guint32 fid_options, mapi_object_t *obj_folder, GError **perror)
+open_folder (EMapiConnection *conn, uint32_t olFolder, mapi_id_t *fid, guint32 fid_options, mapi_object_t *obj_folder, GError **perror)
{
enum MAPISTATUS ms;
@@ -1543,7 +1543,7 @@ open_folder (ExchangeMapiConnection *conn, uint32_t olFolder, mapi_id_t *fid, gu
}
GSList *
-exchange_mapi_connection_check_restriction (ExchangeMapiConnection *conn, mapi_id_t fid, guint32 fid_options, struct mapi_SRestriction *res, GError **perror)
+e_mapi_connection_check_restriction (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, struct mapi_SRestriction *res, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -1557,7 +1557,7 @@ exchange_mapi_connection_check_restriction (ExchangeMapiConnection *conn, mapi_i
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, NULL);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, NULL);
- exchange_mapi_debug_print("%s: Entering %s: folder-id %016" G_GINT64_MODIFIER "X ", G_STRLOC, G_STRFUNC, fid);
+ e_mapi_debug_print("%s: Entering %s: folder-id %016" G_GINT64_MODIFIER "X ", G_STRLOC, G_STRFUNC, fid);
LOCK ();
mem_ctx = talloc_init("ExchangeMAPI_CheckRestriction");
@@ -1640,15 +1640,15 @@ cleanup:
talloc_free (mem_ctx);
UNLOCK();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return mids;
}
-typedef gboolean (*ForeachTableRowCB) (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SRow *srow, guint32 row_index, guint32 rows_total, gpointer user_data, GError **perror);
+typedef gboolean (*ForeachTableRowCB) (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SRow *srow, guint32 row_index, guint32 rows_total, gpointer user_data, GError **perror);
static gboolean
-foreach_tablerow (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, mapi_object_t *obj_table, ForeachTableRowCB cb, gpointer user_data, GError **perror)
+foreach_tablerow (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, mapi_object_t *obj_table, ForeachTableRowCB cb, gpointer user_data, GError **perror)
{
enum MAPISTATUS ms;
struct SRowSet SRowSet;
@@ -1694,7 +1694,7 @@ struct ListItemsInternalData
};
static gboolean
-list_items_internal_cb (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SRow *srow, guint32 row_index, guint32 rows_total, gpointer user_data, GError **perror)
+list_items_internal_cb (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SRow *srow, guint32 row_index, guint32 rows_total, gpointer user_data, GError **perror)
{
struct ListItemsInternalData *lii_data = user_data;
ListItemsData lid;
@@ -1724,7 +1724,7 @@ list_items_internal_cb (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX
}
gboolean
-exchange_mapi_connection_list_items (ExchangeMapiConnection *conn, mapi_id_t fid, guint32 options, ListItemsCB cb, gpointer user_data, GError **perror)
+e_mapi_connection_list_items (EMapiConnection *conn, mapi_id_t fid, guint32 options, ListItemsCB cb, gpointer user_data, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -1783,7 +1783,7 @@ exchange_mapi_connection_list_items (ExchangeMapiConnection *conn, mapi_id_t fid
}
gboolean
-exchange_mapi_connection_fetch_items (ExchangeMapiConnection *conn, mapi_id_t fid,
+e_mapi_connection_fetch_items (EMapiConnection *conn, mapi_id_t fid,
struct mapi_SRestriction *res, struct SSortOrderSet *sort_order,
BuildReadPropsCB build_props, gpointer brp_data,
FetchCallback cb, gpointer data,
@@ -1801,7 +1801,7 @@ exchange_mapi_connection_fetch_items (ExchangeMapiConnection *conn, mapi_id_t
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s: folder-id %016" G_GINT64_MODIFIER "X ", G_STRLOC, G_STRFUNC, fid);
+ e_mapi_debug_print("%s: Entering %s: folder-id %016" G_GINT64_MODIFIER "X ", G_STRLOC, G_STRFUNC, fid);
LOCK ();
mem_ctx = talloc_init("ExchangeMAPI_FetchItems");
@@ -1953,16 +1953,16 @@ exchange_mapi_connection_fetch_items (ExchangeMapiConnection *conn, mapi_id_t
}
if (has_attach && *has_attach && (MAPI_OPTIONS_FETCH_ATTACHMENTS & options)) {
- exchange_mapi_util_get_attachments (conn, fid, &obj_message, &attach_list, NULL);
+ e_mapi_util_get_attachments (conn, fid, &obj_message, &attach_list, NULL);
}
if (options & MAPI_OPTIONS_FETCH_RECIPIENTS) {
- exchange_mapi_util_get_recipients (conn, &obj_message, &recip_list, perror);
+ e_mapi_util_get_recipients (conn, &obj_message, &recip_list, perror);
}
/* 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, &properties_array, (options & MAPI_OPTIONS_GETBESTBODY) != 0);
+ e_mapi_util_read_body_stream (&obj_message, &stream_list, &properties_array, (options & MAPI_OPTIONS_GETBESTBODY) != 0);
}
relax:
@@ -1972,12 +1972,12 @@ exchange_mapi_connection_fetch_items (ExchangeMapiConnection *conn, mapi_id_t
if ((options & MAPI_OPTIONS_DONT_OPEN_MESSAGE) == 0) {
if ((options & MAPI_OPTIONS_FETCH_GENERIC_STREAMS) != 0) {
uint32_t z;
- const uint32_t *cpid = exchange_mapi_util_find_array_propval (&properties_array, PR_INTERNET_CPID);
+ const uint32_t *cpid = e_mapi_util_find_array_propval (&properties_array, PR_INTERNET_CPID);
/* just to get all the other streams */
for (z = 0; z < properties_array.cValues; z++) {
if ((properties_array.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY)
- exchange_mapi_util_read_generic_stream (&obj_message, cpid, properties_array.lpProps[z].ulPropTag, &stream_list, &properties_array, NULL);
+ e_mapi_util_read_generic_stream (&obj_message, cpid, properties_array.lpProps[z].ulPropTag, &stream_list, &properties_array, NULL);
}
}
}
@@ -2002,9 +2002,9 @@ exchange_mapi_connection_fetch_items (ExchangeMapiConnection *conn, mapi_id_t
g_free (item_data);
} else {
- exchange_mapi_util_free_stream_list (&stream_list);
- exchange_mapi_util_free_recipient_list (&recip_list);
- exchange_mapi_util_free_attachment_list (&attach_list);
+ e_mapi_util_free_stream_list (&stream_list);
+ e_mapi_util_free_recipient_list (&recip_list);
+ e_mapi_util_free_attachment_list (&attach_list);
}
if (propsTagArray && propsTagArray->cValues)
@@ -2029,14 +2029,14 @@ exchange_mapi_connection_fetch_items (ExchangeMapiConnection *conn, mapi_id_t
talloc_free (mem_ctx);
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s: folder-id %016" G_GINT64_MODIFIER "X ", G_STRLOC, G_STRFUNC, fid);
+ e_mapi_debug_print("%s: Leaving %s: folder-id %016" G_GINT64_MODIFIER "X ", G_STRLOC, G_STRFUNC, fid);
return result;
}
/* obj_folder and obj_message are released only when obj_folder is not NULL and when returned TRUE */
gboolean
-exchange_mapi_connection_fetch_object_props (ExchangeMapiConnection *conn, mapi_object_t *obj_folder, mapi_id_t fid, mapi_id_t mid, mapi_object_t *obj_message,
+e_mapi_connection_fetch_object_props (EMapiConnection *conn, mapi_object_t *obj_folder, mapi_id_t fid, mapi_id_t mid, mapi_object_t *obj_message,
BuildReadPropsCB build_props, gpointer brp_data,
FetchCallback cb, gpointer data,
guint32 options, GError **perror)
@@ -2053,7 +2053,7 @@ exchange_mapi_connection_fetch_object_props (ExchangeMapiConnection *conn, mapi_
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s: folder %p message %p", G_STRLOC, G_STRFUNC, obj_folder, obj_message);
+ e_mapi_debug_print("%s: Entering %s: folder %p message %p", G_STRLOC, G_STRFUNC, obj_folder, obj_message);
LOCK ();
mem_ctx = talloc_init("ExchangeMAPI_FetchObjectProps");
@@ -2100,20 +2100,20 @@ exchange_mapi_connection_fetch_object_props (ExchangeMapiConnection *conn, mapi_
/* Fetch attachments */
if (options & MAPI_OPTIONS_FETCH_ATTACHMENTS) {
- const bool *has_attach = exchange_mapi_util_find_array_propval (&properties_array, PR_HASATTACH);
+ const bool *has_attach = e_mapi_util_find_array_propval (&properties_array, PR_HASATTACH);
if (has_attach && *has_attach)
- exchange_mapi_util_get_attachments (conn, fid, obj_message, &attach_list, NULL);
+ e_mapi_util_get_attachments (conn, fid, obj_message, &attach_list, NULL);
}
/* Fetch recipients */
if (options & MAPI_OPTIONS_FETCH_RECIPIENTS) {
- exchange_mapi_util_get_recipients (conn, obj_message, &recip_list, NULL);
+ e_mapi_util_get_recipients (conn, obj_message, &recip_list, NULL);
}
/* 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, &properties_array, (options & MAPI_OPTIONS_GETBESTBODY) != 0);
+ e_mapi_util_read_body_stream (obj_message, &stream_list, &properties_array, (options & MAPI_OPTIONS_GETBESTBODY) != 0);
}
if (ms == MAPI_E_SUCCESS) {
@@ -2123,7 +2123,7 @@ exchange_mapi_connection_fetch_object_props (ExchangeMapiConnection *conn, mapi_
/* just to get all the other streams */
for (z = 0; z < properties_array.cValues; z++) {
if ((properties_array.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY) {
- exchange_mapi_util_read_generic_stream (obj_message, exchange_mapi_util_find_array_propval (&properties_array, PR_INTERNET_CPID), properties_array.lpProps[z].ulPropTag, &stream_list, &properties_array, NULL);
+ e_mapi_util_read_generic_stream (obj_message, e_mapi_util_find_array_propval (&properties_array, PR_INTERNET_CPID), properties_array.lpProps[z].ulPropTag, &stream_list, &properties_array, NULL);
}
}
}
@@ -2153,9 +2153,9 @@ exchange_mapi_connection_fetch_object_props (ExchangeMapiConnection *conn, mapi_
g_free (item_data);
} else {
- exchange_mapi_util_free_stream_list (&stream_list);
- exchange_mapi_util_free_recipient_list (&recip_list);
- exchange_mapi_util_free_attachment_list (&attach_list);
+ e_mapi_util_free_stream_list (&stream_list);
+ e_mapi_util_free_recipient_list (&recip_list);
+ e_mapi_util_free_attachment_list (&attach_list);
}
result = ms == MAPI_E_SUCCESS;
@@ -2164,13 +2164,13 @@ cleanup:
talloc_free (mem_ctx);
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
gboolean
-exchange_mapi_connection_fetch_item (ExchangeMapiConnection *conn, mapi_id_t fid, mapi_id_t mid,
+e_mapi_connection_fetch_item (EMapiConnection *conn, mapi_id_t fid, mapi_id_t mid,
BuildReadPropsCB build_props, gpointer brp_data,
FetchCallback cb, gpointer data,
guint32 options, GError **perror)
@@ -2184,7 +2184,7 @@ exchange_mapi_connection_fetch_item (ExchangeMapiConnection *conn, mapi_id_t fid
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s: folder-id %016" G_GINT64_MODIFIER "X message-id %016" G_GINT64_MODIFIER "X",
+ e_mapi_debug_print("%s: Entering %s: folder-id %016" G_GINT64_MODIFIER "X message-id %016" G_GINT64_MODIFIER "X",
G_STRLOC, G_STRFUNC, fid, mid);
LOCK ();
@@ -2205,7 +2205,7 @@ exchange_mapi_connection_fetch_item (ExchangeMapiConnection *conn, mapi_id_t fid
goto cleanup;
}
- result = exchange_mapi_connection_fetch_object_props (conn, &obj_folder, fid, mid, &obj_message, build_props, brp_data, cb, data, options, perror);
+ result = e_mapi_connection_fetch_object_props (conn, &obj_folder, fid, mid, &obj_message, build_props, brp_data, cb, data, options, perror);
cleanup:
if (!result) {
@@ -2215,13 +2215,13 @@ cleanup:
talloc_free (mem_ctx);
UNLOCK ();
- exchange_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
mapi_id_t
-exchange_mapi_connection_create_folder (ExchangeMapiConnection *conn, uint32_t olFolder, mapi_id_t pfid, guint32 fid_options, const gchar *name, GError **perror)
+e_mapi_connection_create_folder (EMapiConnection *conn, uint32_t olFolder, mapi_id_t pfid, guint32 fid_options, const gchar *name, GError **perror)
{
enum MAPISTATUS ms;
mapi_object_t obj_folder;
@@ -2233,7 +2233,7 @@ exchange_mapi_connection_create_folder (ExchangeMapiConnection *conn, uint32_t o
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, 0);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, 0);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
mapi_object_init(&obj_top);
@@ -2282,14 +2282,14 @@ exchange_mapi_connection_create_folder (ExchangeMapiConnection *conn, uint32_t o
}
fid = mapi_object_get_id (&obj_folder);
- exchange_mapi_debug_print("Folder %s created with id %016" G_GINT64_MODIFIER "X ", name, fid);
+ e_mapi_debug_print("Folder %s created with id %016" G_GINT64_MODIFIER "X ", name, fid);
g_static_rec_mutex_lock (&priv->folders_lock);
/* we should also update folder list locally */
if (fid != 0 && priv->folders != NULL) {
- ExchangeMAPIFolder *folder = NULL;
- folder = exchange_mapi_folder_new (name, type, MAPI_PERSONAL_FOLDER, fid, pfid, 0, 0, 0);
+ EMapiFolder *folder = NULL;
+ folder = e_mapi_folder_new (name, type, MAPI_PERSONAL_FOLDER, fid, pfid, 0, 0, 0);
if (folder)
priv->folders = g_slist_append (priv->folders, folder);
}
@@ -2302,14 +2302,14 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
- /* Shouldn't we return (ExchangeMAPIFolder *) instead of a plain fid ? */
+ /* Shouldn't we return (EMapiFolder *) instead of a plain fid ? */
return fid;
}
gboolean
-exchange_mapi_connection_empty_folder (ExchangeMapiConnection *conn, mapi_id_t fid, guint32 fid_options, GError **perror)
+e_mapi_connection_empty_folder (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, GError **perror)
{
enum MAPISTATUS ms;
mapi_object_t obj_folder;
@@ -2318,7 +2318,7 @@ exchange_mapi_connection_empty_folder (ExchangeMapiConnection *conn, mapi_id_t f
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
mapi_object_init (&obj_folder);
@@ -2336,7 +2336,7 @@ exchange_mapi_connection_empty_folder (ExchangeMapiConnection *conn, mapi_id_t f
goto cleanup;
}
- exchange_mapi_debug_print("Folder with id %016" G_GINT64_MODIFIER "X was emptied ", fid);
+ e_mapi_debug_print("Folder with id %016" G_GINT64_MODIFIER "X was emptied ", fid);
result = TRUE;
@@ -2344,18 +2344,18 @@ cleanup:
mapi_object_release(&obj_folder);
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
gboolean
-exchange_mapi_connection_remove_folder (ExchangeMapiConnection *conn, mapi_id_t fid, guint32 fid_options, GError **perror)
+e_mapi_connection_remove_folder (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, GError **perror)
{
enum MAPISTATUS ms;
mapi_object_t obj_top;
mapi_object_t obj_folder;
- ExchangeMAPIFolder *folder;
+ EMapiFolder *folder;
gboolean result = FALSE;
GSList *l;
@@ -2364,10 +2364,10 @@ exchange_mapi_connection_remove_folder (ExchangeMapiConnection *conn, mapi_id_t
g_return_val_if_fail (fid != 0, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
folder = NULL;
- for (l = exchange_mapi_connection_peek_folders_list (conn); l; l = l->next) {
+ for (l = e_mapi_connection_peek_folders_list (conn); l; l = l->next) {
folder = l->data;
if (folder && folder->folder_id == fid)
break;
@@ -2398,7 +2398,7 @@ exchange_mapi_connection_remove_folder (ExchangeMapiConnection *conn, mapi_id_t
goto cleanup;
}
- exchange_mapi_debug_print("Folder with id %016" G_GINT64_MODIFIER "X was emptied ", fid);
+ e_mapi_debug_print("Folder with id %016" G_GINT64_MODIFIER "X was emptied ", fid);
/* Attempt to open the top/parent folder */
ms = open_folder (conn, 0, &folder->parent_folder_id, fid_options, &obj_top, perror);
@@ -2413,7 +2413,7 @@ exchange_mapi_connection_remove_folder (ExchangeMapiConnection *conn, mapi_id_t
goto cleanup;
}
- exchange_mapi_debug_print("Folder with id %016" G_GINT64_MODIFIER "X was deleted ", fid);
+ e_mapi_debug_print("Folder with id %016" G_GINT64_MODIFIER "X was deleted ", fid);
result = TRUE;
@@ -2425,17 +2425,17 @@ cleanup:
priv->folders = g_slist_remove (priv->folders, folder);
g_static_rec_mutex_unlock (&priv->folders_lock);
- exchange_mapi_folder_free (folder);
+ e_mapi_folder_free (folder);
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
gboolean
-exchange_mapi_connection_rename_folder (ExchangeMapiConnection *conn, mapi_id_t fid, guint32 fid_options, const gchar *new_name, GError **perror)
+e_mapi_connection_rename_folder (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, const gchar *new_name, GError **perror)
{
enum MAPISTATUS ms;
mapi_object_t obj_folder;
@@ -2446,7 +2446,7 @@ exchange_mapi_connection_rename_folder (ExchangeMapiConnection *conn, mapi_id_t
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
mem_ctx = talloc_init("ExchangeMAPI_RenameFolder");
@@ -2474,7 +2474,7 @@ cleanup:
talloc_free(mem_ctx);
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
@@ -2482,7 +2482,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_connection_move_folder (ExchangeMapiConnection *conn, mapi_id_t src_fid, mapi_id_t src_parent_fid, guint32 src_fid_options, mapi_id_t des_fid, guint32 des_fid_options, const gchar *new_name, GError **perror)
+e_mapi_connection_move_folder (EMapiConnection *conn, mapi_id_t src_fid, mapi_id_t src_parent_fid, guint32 src_fid_options, mapi_id_t des_fid, guint32 des_fid_options, const gchar *new_name, GError **perror)
{
enum MAPISTATUS ms;
mapi_object_t obj_src, obj_src_parent, obj_des;
@@ -2538,7 +2538,7 @@ cleanup:
/* named_ids_list contains pointers to ResolveNamedIDsData structure */
gboolean
-exchange_mapi_connection_resolve_named_props (ExchangeMapiConnection *conn, mapi_id_t fid, ResolveNamedIDsData *named_ids_list, guint named_ids_n_elems, GError **perror)
+e_mapi_connection_resolve_named_props (EMapiConnection *conn, mapi_id_t fid, ResolveNamedIDsData *named_ids_list, guint named_ids_n_elems, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -2554,7 +2554,7 @@ exchange_mapi_connection_resolve_named_props (ExchangeMapiConnection *conn, mapi
e_return_val_mapi_error_if_fail (named_ids_n_elems > 0, MAPI_E_INVALID_PARAMETER, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print ("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
if (priv->named_ids) {
@@ -2578,7 +2578,7 @@ exchange_mapi_connection_resolve_named_props (ExchangeMapiConnection *conn, mapi
if (!todo) {
UNLOCK ();
- exchange_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return TRUE;
}
}
@@ -2663,14 +2663,14 @@ exchange_mapi_connection_resolve_named_props (ExchangeMapiConnection *conn, mapi
UNLOCK ();
- exchange_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return res;
}
/* returns MAPI_E_RESERVED on any error */
uint32_t
-exchange_mapi_connection_resolve_named_prop (ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t pidlid_propid, GError **perror)
+e_mapi_connection_resolve_named_prop (EMapiConnection *conn, mapi_id_t fid, uint32_t pidlid_propid, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -2682,7 +2682,7 @@ exchange_mapi_connection_resolve_named_prop (ExchangeMapiConnection *conn, mapi_
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, res);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, res);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
@@ -2694,7 +2694,7 @@ exchange_mapi_connection_resolve_named_prop (ExchangeMapiConnection *conn, mapi_
res = GPOINTER_TO_UINT (g_hash_table_lookup (ids, GUINT_TO_POINTER (pidlid_propid)));
if (res != 0) {
UNLOCK ();
- exchange_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return res;
}
@@ -2749,17 +2749,17 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return res;
}
/* returns named id, aka PidLid/PidName for a given proptag, which might be previously
- obtained as a result of exchange_mapi_connection_resolve_named_prop/s.
+ obtained as a result of e_mapi_connection_resolve_named_prop/s.
Returns MAPI_E_RESERVED when not found.
*/
uint32_t
-exchange_mapi_connection_unresolve_proptag_to_nameid (ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t proptag)
+e_mapi_connection_unresolve_proptag_to_nameid (EMapiConnection *conn, mapi_id_t fid, uint32_t proptag)
{
uint32_t res = MAPI_E_RESERVED;
/* to have this used in the below macros */
@@ -2790,7 +2790,7 @@ exchange_mapi_connection_unresolve_proptag_to_nameid (ExchangeMapiConnection *co
}
mapi_id_t
-exchange_mapi_connection_get_default_folder_id (ExchangeMapiConnection *conn, uint32_t olFolder, GError **perror)
+e_mapi_connection_get_default_folder_id (EMapiConnection *conn, uint32_t olFolder, GError **perror)
{
enum MAPISTATUS ms;
mapi_id_t fid = 0;
@@ -2798,7 +2798,7 @@ exchange_mapi_connection_get_default_folder_id (ExchangeMapiConnection *conn, ui
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, 0);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, 0);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
@@ -2811,13 +2811,13 @@ exchange_mapi_connection_get_default_folder_id (ExchangeMapiConnection *conn, ui
cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return (ms == MAPI_E_SUCCESS ? fid : 0);
}
mapi_id_t
-exchange_mapi_connection_create_item (ExchangeMapiConnection *conn, uint32_t olFolder, mapi_id_t fid,
+e_mapi_connection_create_item (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid,
BuildWritePropsCB build_props, gpointer bwp_data,
GSList *recipients, GSList *attachments, GSList *generic_streams,
uint32_t options, GError **perror)
@@ -2833,7 +2833,7 @@ exchange_mapi_connection_create_item (ExchangeMapiConnection *conn, uint32_t olF
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, 0);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, 0);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
@@ -2858,7 +2858,7 @@ exchange_mapi_connection_create_item (ExchangeMapiConnection *conn, uint32_t olF
/* Add regular props using callback */
if (build_props && !build_props (conn, fid, mem_ctx, &props, &propslen, bwp_data)) {
- exchange_mapi_debug_print ("%s: (%s): build_props failed! propslen = %d ", G_STRLOC, G_STRFUNC, propslen);
+ e_mapi_debug_print ("%s: (%s): build_props failed! propslen = %d ", G_STRLOC, G_STRFUNC, propslen);
make_mapi_error (perror, "build_props", MAPI_E_CALL_FAILED);
goto cleanup;
}
@@ -2871,19 +2871,19 @@ exchange_mapi_connection_create_item (ExchangeMapiConnection *conn, uint32_t olF
}
if (generic_streams) {
- if (!exchange_mapi_util_write_generic_streams (&obj_message, generic_streams, perror))
+ if (!e_mapi_util_write_generic_streams (&obj_message, generic_streams, perror))
goto cleanup;
}
/* Set attachments if any */
if (attachments) {
- if (!exchange_mapi_util_set_attachments (conn, fid, mem_ctx, &obj_message, attachments, FALSE, perror))
+ if (!e_mapi_util_set_attachments (conn, fid, mem_ctx, &obj_message, attachments, FALSE, perror))
goto cleanup;
}
/* Set recipients if any */
if (recipients) {
- if (!exchange_mapi_util_modify_recipients (conn, mem_ctx, &obj_message, recipients, FALSE, perror))
+ if (!e_mapi_util_modify_recipients (conn, mem_ctx, &obj_message, recipients, FALSE, perror))
goto cleanup;
}
@@ -2936,13 +2936,13 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return mid;
}
gboolean
-exchange_mapi_connection_modify_item (ExchangeMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, mapi_id_t mid,
+e_mapi_connection_modify_item (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, mapi_id_t mid,
BuildWritePropsCB build_props, gpointer bwp_data,
GSList *recipients, GSList *attachments, GSList *generic_streams,
uint32_t options, GError **perror)
@@ -2958,7 +2958,7 @@ exchange_mapi_connection_modify_item (ExchangeMapiConnection *conn, uint32_t olF
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
@@ -2983,7 +2983,7 @@ exchange_mapi_connection_modify_item (ExchangeMapiConnection *conn, uint32_t olF
/* Add regular props using callback */
if (build_props && !build_props (conn, fid, mem_ctx, &props, &propslen, bwp_data)) {
- exchange_mapi_debug_print ("%s: (%s): Could not build props ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: (%s): Could not build props ", G_STRLOC, G_STRFUNC);
make_mapi_error (perror, "build_props", MAPI_E_CALL_FAILED);
goto cleanup;
}
@@ -2996,21 +2996,21 @@ exchange_mapi_connection_modify_item (ExchangeMapiConnection *conn, uint32_t olF
}
if (generic_streams) {
- if (!exchange_mapi_util_write_generic_streams (&obj_message, generic_streams, perror))
+ if (!e_mapi_util_write_generic_streams (&obj_message, generic_streams, perror))
goto cleanup;
}
/* Set attachments if any */
if (attachments) {
- if (!exchange_mapi_util_set_attachments (conn, fid, mem_ctx, &obj_message, attachments, TRUE, perror))
+ if (!e_mapi_util_set_attachments (conn, fid, mem_ctx, &obj_message, attachments, TRUE, perror))
goto cleanup;
} else {
- exchange_mapi_util_delete_attachments (&obj_message, NULL);
+ e_mapi_util_delete_attachments (&obj_message, NULL);
}
/* Set recipients if any */
if (recipients) {
- if (!exchange_mapi_util_modify_recipients (conn, mem_ctx, &obj_message, recipients, TRUE, perror))
+ if (!e_mapi_util_modify_recipients (conn, mem_ctx, &obj_message, recipients, TRUE, perror))
goto cleanup;
}
@@ -3039,13 +3039,13 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
gboolean
-exchange_mapi_connection_set_flags (ExchangeMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, guint32 fid_options, GSList *mids, uint32_t flag, GError **perror)
+e_mapi_connection_set_flags (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, guint32 fid_options, GSList *mids, uint32_t flag, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -3058,7 +3058,7 @@ exchange_mapi_connection_set_flags (ExchangeMapiConnection *conn, uint32_t olFol
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
mem_ctx = talloc_init("ExchangeMAPI_SetFlags");
@@ -3088,13 +3088,13 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
static gboolean
-mapi_move_items (ExchangeMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mid_list, gboolean do_copy, GError **perror)
+mapi_move_items (EMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mid_list, gboolean do_copy, GError **perror)
{
enum MAPISTATUS ms;
mapi_object_t obj_folder_src;
@@ -3144,45 +3144,45 @@ cleanup:
}
gboolean
-exchange_mapi_connection_copy_items (ExchangeMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mids, GError **perror)
+e_mapi_connection_copy_items (EMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mids, GError **perror)
{
enum MAPISTATUS ms;
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, MAPI_E_INVALID_PARAMETER);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, MAPI_E_INVALID_PARAMETER);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
ms = mapi_move_items (conn, src_fid, src_fid_options, dest_fid, dest_fid_options, mids, TRUE, perror);
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return ms == MAPI_E_SUCCESS;
}
gboolean
-exchange_mapi_connection_move_items (ExchangeMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mids, GError **perror)
+e_mapi_connection_move_items (EMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mids, GError **perror)
{
enum MAPISTATUS ms;
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, MAPI_E_INVALID_PARAMETER);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, MAPI_E_INVALID_PARAMETER);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
ms = mapi_move_items (conn, src_fid, src_fid_options, dest_fid, dest_fid_options, mids, FALSE, perror);
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return ms == MAPI_E_SUCCESS;
}
gboolean
-exchange_mapi_connection_remove_items (ExchangeMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, guint32 fid_options, GSList *mids, GError **perror)
+e_mapi_connection_remove_items (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, guint32 fid_options, GSList *mids, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -3195,7 +3195,7 @@ exchange_mapi_connection_remove_items (ExchangeMapiConnection *conn, uint32_t ol
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
@@ -3229,13 +3229,13 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
static gboolean
-get_child_folders (TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier, mapi_object_t *parent,
+get_child_folders (TALLOC_CTX *mem_ctx, EMapiFolderCategory folder_hier, mapi_object_t *parent,
mapi_id_t folder_id, GSList **mapi_folders, GError **perror)
{
enum MAPISTATUS ms;
@@ -3308,24 +3308,24 @@ get_child_folders (TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier,
}
for (i = 0; i < rowset.cRows; i++) {
- ExchangeMAPIFolder *folder = NULL;
+ EMapiFolder *folder = NULL;
- const mapi_id_t *fid = (const mapi_id_t *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_FID);
- const mapi_id_t *pid = (const mapi_id_t *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_PARENT_FID);
- const gchar *class = (const gchar *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_CONTAINER_CLASS);
- const gchar *name = (const gchar *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_DISPLAY_NAME_UNICODE);
- const uint32_t *unread = (const uint32_t *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_CONTENT_UNREAD);
- const uint32_t *total = (const uint32_t *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_CONTENT_COUNT);
- const uint32_t *child = (const uint32_t *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_FOLDER_CHILD_COUNT);
- const uint32_t *folder_size = (const uint32_t *)exchange_mapi_util_find_row_propval (&rowset.aRow[i], PR_MESSAGE_SIZE);
+ const mapi_id_t *fid = (const mapi_id_t *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_FID);
+ const mapi_id_t *pid = (const mapi_id_t *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_PARENT_FID);
+ const gchar *class = (const gchar *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_CONTAINER_CLASS);
+ const gchar *name = (const gchar *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_DISPLAY_NAME_UNICODE);
+ const uint32_t *unread = (const uint32_t *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_CONTENT_UNREAD);
+ const uint32_t *total = (const uint32_t *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_CONTENT_COUNT);
+ const uint32_t *child = (const uint32_t *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_FOLDER_CHILD_COUNT);
+ const uint32_t *folder_size = (const uint32_t *)e_mapi_util_find_row_propval (&rowset.aRow[i], PR_MESSAGE_SIZE);
if (!class)
class = IPF_NOTE;
- exchange_mapi_debug_print("|---+ %-15s : (Container class: %s %016" G_GINT64_MODIFIER "X) UnRead : %d Total : %d size : %d",
+ e_mapi_debug_print("|---+ %-15s : (Container class: %s %016" G_GINT64_MODIFIER "X) UnRead : %d Total : %d size : %d",
name, class, *fid, unread ? *unread : 0, total ? *total : 0, folder_size ? *folder_size : 0);
- folder = exchange_mapi_folder_new (name, class, folder_hier, *fid, pid ? *pid : folder_id,
+ folder = e_mapi_folder_new (name, class, folder_hier, *fid, pid ? *pid : folder_id,
child ? *child : 0, unread ? *unread : 0, total ? *total : 0);
folder->size = folder_size ? *folder_size : 0;
@@ -3416,7 +3416,7 @@ mapi_get_ren_additional_fids (mapi_object_t *obj_store, GHashTable **folder_list
aRow.cValues = count;
aRow.lpProps = lpProps;
- entryids = (const struct BinaryArray_r *) exchange_mapi_util_find_row_propval (&aRow, PR_ADDITIONAL_REN_ENTRYIDS);
+ entryids = (const struct BinaryArray_r *) e_mapi_util_find_row_propval (&aRow, PR_ADDITIONAL_REN_ENTRYIDS);
/* Iterate through MV_BINARY */
if (entryids) {
@@ -3430,7 +3430,7 @@ mapi_get_ren_additional_fids (mapi_object_t *obj_store, GHashTable **folder_list
*folder_type = olfolder_defaults[i];
g_hash_table_insert (*folder_list,
- exchange_mapi_util_mapi_id_to_string (fid),
+ e_mapi_util_mapi_id_to_string (fid),
folder_type);
}
}
@@ -3457,13 +3457,13 @@ set_default_folders (mapi_object_t *obj_store, GSList **mapi_folders, GError **p
}
while (folder_list != NULL) {
- ExchangeMAPIFolder *folder = NULL;
+ EMapiFolder *folder = NULL;
guint32 default_type = 0;
gchar *key_fid = NULL;
gpointer value = NULL;
folder = folder_list->data;
- key_fid = exchange_mapi_util_mapi_id_to_string (folder->folder_id);
+ key_fid = e_mapi_util_mapi_id_to_string (folder->folder_id);
if ((value = g_hash_table_lookup (default_folders, key_fid)) != NULL)
default_type = *(guint32 *)value;
@@ -3485,19 +3485,19 @@ set_default_folders (mapi_object_t *obj_store, GSList **mapi_folders, GError **p
static void
set_owner_name (gpointer data, gpointer user_data)
{
- ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *)(data);
+ EMapiFolder *folder = (EMapiFolder *)(data);
folder->owner_name = (gchar *)(user_data);
}
static void
set_user_name (gpointer data, gpointer user_data)
{
- ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *)(data);
+ EMapiFolder *folder = (EMapiFolder *)(data);
folder->user_name = (gchar *)(user_data);
}
gboolean
-exchange_mapi_connection_get_folders_list (ExchangeMapiConnection *conn, GSList **mapi_folders, GError **perror)
+e_mapi_connection_get_folders_list (EMapiConnection *conn, GSList **mapi_folders, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -3506,7 +3506,7 @@ exchange_mapi_connection_get_folders_list (ExchangeMapiConnection *conn, GSList
struct SRow aRow;
gboolean result = FALSE;
mapi_id_t mailbox_id;
- ExchangeMAPIFolder *folder;
+ EMapiFolder *folder;
uint32_t count = 0;
const gchar *mailbox_name = NULL;
const gchar *mailbox_owner_name = NULL;
@@ -3516,7 +3516,7 @@ exchange_mapi_connection_get_folders_list (ExchangeMapiConnection *conn, GSList
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
@@ -3544,10 +3544,10 @@ exchange_mapi_connection_get_folders_list (ExchangeMapiConnection *conn, GSList
aRow.lpProps = lpProps;
/* betting that these will never fail */
- mailbox_name = (const gchar *) exchange_mapi_util_find_row_propval (&aRow, PR_DISPLAY_NAME_UNICODE);
- mailbox_owner_name = (const gchar *) exchange_mapi_util_find_row_propval (&aRow, PR_MAILBOX_OWNER_NAME_UNICODE);
- mailbox_user_name = (const gchar *) exchange_mapi_util_find_row_propval (&aRow, PidTagMailboxOwnerName);
- mailbox_size = (const uint32_t *)exchange_mapi_util_find_row_propval (&aRow, PR_MESSAGE_SIZE);
+ mailbox_name = (const gchar *) e_mapi_util_find_row_propval (&aRow, PR_DISPLAY_NAME_UNICODE);
+ mailbox_owner_name = (const gchar *) e_mapi_util_find_row_propval (&aRow, PR_MAILBOX_OWNER_NAME_UNICODE);
+ mailbox_user_name = (const gchar *) e_mapi_util_find_row_propval (&aRow, PidTagMailboxOwnerName);
+ mailbox_size = (const uint32_t *)e_mapi_util_find_row_propval (&aRow, PR_MESSAGE_SIZE);
/* Prepare the directory listing */
ms = GetDefaultFolder (&priv->msg_store, &mailbox_id, olFolderTopInformationStore);
@@ -3557,7 +3557,7 @@ exchange_mapi_connection_get_folders_list (ExchangeMapiConnection *conn, GSList
}
/* FIXME: May have to get the child folders count? Do we need/use it? */
- folder = exchange_mapi_folder_new (mailbox_name, IPF_NOTE,
+ folder = e_mapi_folder_new (mailbox_name, IPF_NOTE,
MAPI_PERSONAL_FOLDER, mailbox_id, 0, 0, 0 ,0);
folder->is_default = true;
folder->default_type = olFolderTopInformationStore; /*Is this correct ?*/
@@ -3582,24 +3582,24 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
gboolean
-exchange_mapi_connection_get_pf_folders_list (ExchangeMapiConnection *conn, GSList **mapi_folders, GError **perror)
+e_mapi_connection_get_pf_folders_list (EMapiConnection *conn, GSList **mapi_folders, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
gboolean result = FALSE;
mapi_id_t mailbox_id;
- ExchangeMAPIFolder *folder;
+ EMapiFolder *folder;
CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
LOCK ();
mem_ctx = talloc_init("ExchangeMAPI_PF_GetFoldersList");
@@ -3613,7 +3613,7 @@ exchange_mapi_connection_get_pf_folders_list (ExchangeMapiConnection *conn, GSLi
goto cleanup;
}
- folder = exchange_mapi_folder_new (_("All Public Folders"), IPF_NOTE, 0, mailbox_id, 0, 0, 0 ,0);
+ folder = e_mapi_folder_new (_("All Public Folders"), IPF_NOTE, 0, mailbox_id, 0, 0, 0 ,0);
folder->is_default = true;
folder->default_type = olPublicFoldersAllPublicFolders;
*mapi_folders = g_slist_prepend (*mapi_folders, folder);
@@ -3625,13 +3625,13 @@ cleanup:
UNLOCK ();
- exchange_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return result;
}
GSList *
-exchange_mapi_connection_peek_folders_list (ExchangeMapiConnection *conn)
+e_mapi_connection_peek_folders_list (EMapiConnection *conn)
{
/* to have this used in the below macros */
GError **perror = NULL;
@@ -3643,7 +3643,7 @@ exchange_mapi_connection_peek_folders_list (ExchangeMapiConnection *conn)
if (!priv->folders) {
LOCK ();
- exchange_mapi_connection_get_folders_list (conn, &priv->folders, perror);
+ e_mapi_connection_get_folders_list (conn, &priv->folders, perror);
UNLOCK ();
}
@@ -3654,7 +3654,7 @@ exchange_mapi_connection_peek_folders_list (ExchangeMapiConnection *conn)
/* free returned pointer with g_free() */
gchar *
-exchange_mapi_connection_ex_to_smtp (ExchangeMapiConnection *conn, const gchar *ex_address, gchar **display_name, GError **perror)
+e_mapi_connection_ex_to_smtp (EMapiConnection *conn, const gchar *ex_address, gchar **display_name, GError **perror)
{
enum MAPISTATUS ms;
TALLOC_CTX *mem_ctx;
@@ -3685,9 +3685,9 @@ exchange_mapi_connection_ex_to_smtp (ExchangeMapiConnection *conn, const gchar *
ms = ResolveNames (priv->session, (const gchar **)str_array, SPropTagArray, &SRowSet, &flaglist, 0);
if (ms == MAPI_E_SUCCESS && SRowSet && SRowSet->cRows == 1) {
- smtp_addr = g_strdup (exchange_mapi_util_find_row_propval (SRowSet->aRow, PR_SMTP_ADDRESS_UNICODE));
+ smtp_addr = g_strdup (e_mapi_util_find_row_propval (SRowSet->aRow, PR_SMTP_ADDRESS_UNICODE));
if (display_name)
- *display_name = g_strdup (exchange_mapi_util_find_row_propval (SRowSet->aRow, PR_DISPLAY_NAME_UNICODE));
+ *display_name = g_strdup (e_mapi_util_find_row_propval (SRowSet->aRow, PR_DISPLAY_NAME_UNICODE));
}
talloc_free (mem_ctx);
@@ -3701,7 +3701,7 @@ exchange_mapi_connection_ex_to_smtp (ExchangeMapiConnection *conn, const gchar *
}
gboolean
-exchange_mapi_connection_events_init (ExchangeMapiConnection *conn, GError **perror)
+e_mapi_connection_events_init (EMapiConnection *conn, GError **perror)
{
enum MAPISTATUS ms;
@@ -3719,7 +3719,7 @@ exchange_mapi_connection_events_init (ExchangeMapiConnection *conn, GError **per
}
gboolean
-exchange_mapi_connection_events_subscribe (ExchangeMapiConnection *conn, guint32 options,
+e_mapi_connection_events_subscribe (EMapiConnection *conn, guint32 options,
guint16 event_mask, guint32 *events_conn_id,
mapi_notify_callback_t callback, gpointer data, GError **perror)
{
@@ -3754,7 +3754,7 @@ exchange_mapi_connection_events_subscribe (ExchangeMapiConnection *conn, guint32
}
gboolean
-exchange_mapi_connection_events_unsubscribe (ExchangeMapiConnection *conn, guint32 events_conn_id, GError **perror)
+e_mapi_connection_events_unsubscribe (EMapiConnection *conn, guint32 events_conn_id, GError **perror)
{
enum MAPISTATUS ms;
@@ -3773,7 +3773,7 @@ exchange_mapi_connection_events_unsubscribe (ExchangeMapiConnection *conn, guint
/* Note : Blocking infinite loop. */
gboolean
-exchange_mapi_connection_events_monitor (ExchangeMapiConnection *conn, struct mapi_notify_continue_callback_data *cb_data)
+e_mapi_connection_events_monitor (EMapiConnection *conn, struct mapi_notify_continue_callback_data *cb_data)
{
enum MAPISTATUS ms;
/* to have this used in the below macros */
@@ -3801,7 +3801,7 @@ static gboolean
try_create_profile_main_thread_cb (struct tcp_data *data)
{
EAccountList *accounts;
- ExchangeMapiProfileData empd = { 0 };
+ EMapiProfileData empd = { 0 };
EIterator *iter;
GConfClient *gconf;
@@ -3824,12 +3824,12 @@ try_create_profile_main_thread_cb (struct tcp_data *data)
empd.server = url->host;
empd.username = url->user;
- exchange_mapi_util_profiledata_from_settings (&empd, CAMEL_MAPI_SETTINGS (settings));
+ e_mapi_util_profiledata_from_settings (&empd, CAMEL_MAPI_SETTINGS (settings));
/* cast away the const, but promise not to touch it */
empd.password = (gchar*)data->password;
if (COMPLETE_PROFILEDATA(&empd)) {
- gchar *profname = exchange_mapi_util_profile_name (&empd, FALSE);
+ gchar *profname = e_mapi_util_profile_name (&empd, FALSE);
if (profname && g_str_equal (profname, data->profname)) {
/* do not use locking here, because when this is called then other thread is holding the lock */
@@ -3961,7 +3961,7 @@ mapi_profile_load (const gchar *profname, const gchar *password, GError **perror
g_static_rec_mutex_lock (&profile_mutex);
- exchange_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print("%s: Entering %s ", G_STRLOC, G_STRFUNC);
if (!ensure_mapi_init_called (perror))
goto cleanup;
@@ -3973,7 +3973,7 @@ mapi_profile_load (const gchar *profname, const gchar *password, GError **perror
SetMAPIDebugLevel (mapi_ctx, debug_log_level);
}
- exchange_mapi_debug_print("Loading profile %s ", profname);
+ e_mapi_debug_print("Loading profile %s ", profname);
ms = MapiLogonEx (mapi_ctx, &session, profname, password);
if (ms == MAPI_E_NOT_FOUND && try_create_profile (profname, password))
@@ -3986,7 +3986,7 @@ mapi_profile_load (const gchar *profname, const gchar *password, GError **perror
cleanup:
g_static_rec_mutex_unlock (&profile_mutex);
- exchange_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
+ e_mapi_debug_print ("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
return session;
}
@@ -4001,7 +4001,7 @@ create_profile_fallback_callback (struct SRowSet *rowset, gconstpointer data)
for (ii = 0; ii < rowset->cRows; ii++) {
const gchar *account_name;
- account_name = exchange_mapi_util_find_row_propval (&(rowset->aRow[ii]), PR_ACCOUNT_UNICODE);
+ account_name = e_mapi_util_find_row_propval (&(rowset->aRow[ii]), PR_ACCOUNT_UNICODE);
if (account_name && g_strcmp0 (username, account_name) == 0)
return ii;
@@ -4012,7 +4012,7 @@ create_profile_fallback_callback (struct SRowSet *rowset, gconstpointer data)
}
static gboolean
-mapi_profile_create (const ExchangeMapiProfileData *empd,
+mapi_profile_create (const EMapiProfileData *empd,
mapi_profile_callback_t callback, gconstpointer data,
GError **perror,
gboolean use_locking)
@@ -4035,7 +4035,7 @@ mapi_profile_create (const ExchangeMapiProfileData *empd,
if (use_locking)
g_static_rec_mutex_lock (&profile_mutex);
- exchange_mapi_debug_print ("Create profile with %s %s %s\n", empd->username,
+ e_mapi_debug_print ("Create profile with %s %s %s\n", empd->username,
empd->domain, empd->server);
if (!ensure_mapi_init_called (perror)) {
@@ -4044,7 +4044,7 @@ mapi_profile_create (const ExchangeMapiProfileData *empd,
return FALSE;
}
- profname = exchange_mapi_util_profile_name (empd, TRUE);
+ profname = e_mapi_util_profile_name (empd, TRUE);
/* Delete any existing profiles with the same profilename */
ms = DeleteProfile (mapi_ctx, profname);
@@ -4084,25 +4084,25 @@ mapi_profile_create (const ExchangeMapiProfileData *empd,
#undef add_string_attr
/* Login now */
- exchange_mapi_debug_print("Logging into the server... ");
+ e_mapi_debug_print("Logging into the server... ");
ms = MapiLogonProvider (mapi_ctx, &session, profname, empd->password,
PROVIDER_ID_NSPI);
if (ms != MAPI_E_SUCCESS) {
make_mapi_error (perror, "MapiLogonProvider", ms);
- exchange_mapi_debug_print ("Deleting profile %s ", profname);
+ e_mapi_debug_print ("Deleting profile %s ", profname);
DeleteProfile (mapi_ctx, profname);
goto cleanup;
}
- exchange_mapi_debug_print("MapiLogonProvider : succeeded \n");
+ e_mapi_debug_print("MapiLogonProvider : succeeded \n");
ms = ProcessNetworkProfile (session, empd->username, callback, data);
if (ms != MAPI_E_SUCCESS) {
make_mapi_error (perror, "ProcessNetworkProfile", ms);
- exchange_mapi_debug_print ("Deleting profile %s ", profname);
+ e_mapi_debug_print ("Deleting profile %s ", profname);
DeleteProfile (mapi_ctx, profname);
goto cleanup;
}
- exchange_mapi_debug_print("ProcessNetworkProfile : succeeded \n");
+ e_mapi_debug_print("ProcessNetworkProfile : succeeded \n");
result = TRUE;
@@ -4133,7 +4133,7 @@ mapi_profile_create (const ExchangeMapiProfileData *empd,
}
gboolean
-exchange_mapi_create_profile (ExchangeMapiProfileData *empd,
+e_mapi_create_profile (EMapiProfileData *empd,
mapi_profile_callback_t callback, gconstpointer data,
GError **perror)
{
@@ -4141,7 +4141,7 @@ exchange_mapi_create_profile (ExchangeMapiProfileData *empd,
}
gboolean
-exchange_mapi_delete_profile (const gchar *profile, GError **perror)
+e_mapi_delete_profile (const gchar *profile, GError **perror)
{
gboolean result = FALSE;
@@ -4150,7 +4150,7 @@ exchange_mapi_delete_profile (const gchar *profile, GError **perror)
if (ensure_mapi_init_called (perror)) {
enum MAPISTATUS ms;
- exchange_mapi_debug_print ("Deleting profile %s ", profile);
+ e_mapi_debug_print ("Deleting profile %s ", profile);
ms = DeleteProfile (mapi_ctx, profile);
if (ms == MAPI_E_SUCCESS) {
@@ -4166,7 +4166,7 @@ exchange_mapi_delete_profile (const gchar *profile, GError **perror)
}
void
-exchange_mapi_rename_profile (const gchar *old_name, const gchar *new_name)
+e_mapi_rename_profile (const gchar *old_name, const gchar *new_name)
{
g_return_if_fail (old_name != NULL);
g_return_if_fail (new_name != NULL);
diff --git a/src/libexchangemapi/e-mapi-connection.h b/src/libexchangemapi/e-mapi-connection.h
new file mode 100644
index 0000000..6ff6ca6
--- /dev/null
+++ b/src/libexchangemapi/e-mapi-connection.h
@@ -0,0 +1,278 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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/>
+ *
+ *
+ * Authors:
+ * Srinivasa Ragavan <sragavan novell com>
+ * Suman Manjunath <msuman novell com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#ifndef E_MAPI_CONNECTION_H
+#define E_MAPI_CONNECTION_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <libmapi/libmapi.h>
+
+/* Standard GObject macros */
+#define E_MAPI_TYPE_CONNECTION (e_mapi_connection_get_type ())
+#define E_MAPI_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_MAPI_TYPE_CONNECTION, EMapiConnection))
+#define E_MAPI_CONNECTION_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST ((cls), E_MAPI_TYPE_CONNECTION, EMapiConnectionClass))
+#define E_MAPI_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_MAPI_TYPE_CONNECTION))
+#define E_MAPI_IS_CONNECTION_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE ((cls), E_MAPI_TYPE_CONNECTION))
+#define E_MAPI_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_MAPI_TYPE_CONNECTION, EMapiConnectionClass))
+
+G_BEGIN_DECLS
+
+GQuark e_mapi_error_quark (void);
+#define E_MAPI_ERROR e_mapi_error_quark ()
+
+typedef struct _EMapiConnection EMapiConnection;
+typedef struct _EMapiConnectionClass EMapiConnectionClass;
+typedef struct _EMapiConnectionPrivate EMapiConnectionPrivate;
+
+typedef enum {
+ MAPI_OPTIONS_FETCH_ATTACHMENTS = 1<<0,
+ MAPI_OPTIONS_FETCH_RECIPIENTS = 1<<1,
+ 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_GETBESTBODY = 1<<6,
+ MAPI_OPTIONS_USE_PFSTORE = 1<<7,
+ MAPI_OPTIONS_DONT_OPEN_MESSAGE = 1<<8,
+ MAPI_OPTIONS_DELETE_ON_SUBMIT_FAILURE = 1<<9
+} ExchangeMAPIOptions;
+
+/* Flags for push notification APIs*/
+typedef enum {
+ MAPI_EVENTS_USE_STORE = 1<<0,
+ MAPI_EVENTS_USE_PF_STORE = 1<<1,
+ MAPI_EVENTS_FOLDER = 1<<2,
+} ExchangeMAPIEventsOptions;
+
+#define MAPI_OPTIONS_FETCH_ALL MAPI_OPTIONS_FETCH_ATTACHMENTS | \
+ MAPI_OPTIONS_FETCH_RECIPIENTS | \
+ MAPI_OPTIONS_FETCH_BODY_STREAM | \
+ MAPI_OPTIONS_FETCH_GENERIC_STREAMS
+
+typedef struct {
+ GByteArray *value;
+ uint32_t proptag;
+} ExchangeMAPIStream;
+
+typedef struct {
+ GByteArray *value;
+ uint32_t proptag;
+ uint32_t editor_format;
+} ExchangeMAPIBodyStream;
+
+typedef struct {
+ /* MANDATORY */
+ TALLOC_CTX *mem_ctx;
+ const gchar *email_id;
+ const gchar *display_name;
+
+ /* 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
+ * recipients regardless if the recipient is resolved or not */
+ uint32_t req_cValues;
+ struct SPropValue *req_lpProps;
+
+ /* These are properties which would be set on the
+ * recipients only if the recipient is MAPI_UNRESOLVED */
+ uint32_t ext_cValues;
+ struct SPropValue *ext_lpProps;
+ } in;
+
+ /* These are properties which would be set on the
+ * recipients after GetRecipientTable() */
+ struct SRow out_SRow;
+} ExchangeMAPIRecipient;
+
+struct _MailItem;
+
+typedef struct {
+ uint32_t cValues;
+ struct SPropValue *lpProps;
+ GSList *streams;
+ GSList *objects;
+ struct _MailItem *mail; /* not NULL when writing mail attachment; in this case are other members ignored */
+} ExchangeMAPIAttachment;
+
+typedef struct {
+ EMapiConnection *conn;
+ struct mapi_SPropValue_array *properties;
+ mapi_id_t fid;
+ mapi_id_t mid;
+ uint32_t msg_flags; /* used only with fetch_items */
+ GSList *attachments;
+ GSList *recipients;
+ GSList *gallist;
+ GSList *streams;
+ guint total; /*Total number of results*/
+ guint index; /*Index of this Item*/
+} FetchItemsCallbackData;
+
+struct id_list {
+ mapi_id_t id;
+};
+
+typedef struct {
+ uint32_t pidlid_propid; /* PidLid or PidName legacy property named ID to resolve */
+ uint32_t propid; /* resolved prop ID; equals to MAPI_E_RESERVED when not found or other error */
+} ResolveNamedIDsData;
+
+typedef struct {
+ mapi_id_t mid; /* message ID, from PR_MID */
+ uint32_t msg_flags; /* MAPI MSGFLAG_* bit OR, from PR_MESSAGE_FLAGS */
+ time_t last_modified; /* PR_LAST_MODIFICATION_TIME as UTC */
+} ListItemsData;
+
+typedef gboolean (*FetchCallback) (FetchItemsCallbackData *item_data, gpointer data);
+typedef gboolean (*FetchGALCallback) (EMapiConnection *conn, uint32_t row_index, uint32_t n_rows, struct SRow *aRow, gpointer data);
+typedef gboolean (*BuildWritePropsCB) (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data);
+typedef gboolean (*BuildReadPropsCB) (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data);
+typedef gboolean (*ListItemsCB) (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, const ListItemsData *item_data, guint32 item_index, guint32 items_total, gpointer user_data, GError **perror);
+
+struct _EMapiConnection {
+ GObject parent;
+
+ EMapiConnectionPrivate *priv;
+};
+
+struct _EMapiConnectionClass {
+ GObjectClass parent_class;
+
+ /* signals */
+};
+
+GType e_mapi_connection_get_type (void);
+EMapiConnection *e_mapi_connection_new (const gchar *profile, const gchar *password, GError **perror);
+EMapiConnection *e_mapi_connection_find (const gchar *profile);
+gboolean e_mapi_connection_reconnect (EMapiConnection *conn, const gchar *password, GError **perror);
+gboolean e_mapi_connection_close (EMapiConnection *conn);
+gboolean e_mapi_connection_connected (EMapiConnection *conn);
+
+gboolean e_mapi_connection_list_items (EMapiConnection *conn, mapi_id_t fid, guint32 options,
+ ListItemsCB cb, gpointer user_data, GError **perror);
+
+gboolean e_mapi_connection_fetch_object_props (
+ EMapiConnection *conn, mapi_object_t *obj_folder, mapi_id_t fid, mapi_id_t mid, mapi_object_t *obj_message,
+ BuildReadPropsCB build_props, gpointer brp_data,
+ FetchCallback cb, gpointer data,
+ guint32 options, GError **perror);
+
+gboolean e_mapi_connection_fetch_item (EMapiConnection *conn, mapi_id_t fid, mapi_id_t mid,
+ BuildReadPropsCB build_props, gpointer brp_data,
+ FetchCallback cb, gpointer data,
+ guint32 options, GError **perror);
+
+gboolean e_mapi_connection_fetch_items (EMapiConnection *conn, mapi_id_t fid,
+ struct mapi_SRestriction *res, struct SSortOrderSet *sort_order,
+ BuildReadPropsCB build_props, gpointer brp_data,
+ FetchCallback cb, gpointer data,
+ guint32 options, GError **perror);
+
+gboolean e_mapi_connection_fetch_gal (EMapiConnection *conn, struct mapi_SRestriction *restrictions,
+ BuildReadPropsCB build_props, gpointer brp_data,
+ FetchGALCallback cb, gpointer data, GError **perror);
+
+gboolean e_mapi_connection_get_public_folder (EMapiConnection *conn, mapi_object_t *obj_object, GError **perror);
+
+mapi_id_t e_mapi_connection_create_folder (EMapiConnection *conn, uint32_t olFolder, mapi_id_t pfid, guint32 fid_options, const gchar *name, GError **perror);
+gboolean e_mapi_connection_remove_folder (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, GError **perror);
+gboolean e_mapi_connection_empty_folder (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, GError **perror);
+gboolean e_mapi_connection_rename_folder (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, const gchar *new_name, GError **perror);
+gboolean e_mapi_connection_move_folder (EMapiConnection *conn, mapi_id_t src_fid, mapi_id_t src_parent_fid, guint32 src_fid_options, mapi_id_t des_fid, guint32 des_fid_options, const gchar *new_name, GError **perror);
+GSList * e_mapi_connection_check_restriction (EMapiConnection *conn, mapi_id_t fid, guint32 fid_options, struct mapi_SRestriction *res, GError **perror);
+mapi_id_t e_mapi_connection_get_default_folder_id (EMapiConnection *conn, uint32_t olFolder, GError **perror);
+mapi_id_t e_mapi_connection_create_item (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid,
+ BuildWritePropsCB build_props, gpointer bwp_data,
+ GSList *recipients, GSList *attachments, GSList *generic_streams,
+ uint32_t options, GError **perror);
+
+gboolean e_mapi_connection_modify_item (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, mapi_id_t mid,
+ BuildWritePropsCB build_props, gpointer bwp_data,
+ GSList *recipients, GSList *attachments, GSList *generic_streams,
+ uint32_t options, GError **perror);
+
+gboolean e_mapi_connection_set_flags (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, guint32 fid_options, GSList *mid_list, uint32_t flag, GError **perror);
+gboolean e_mapi_connection_remove_items (EMapiConnection *conn, uint32_t olFolder, mapi_id_t fid, guint32 fid_options, GSList *mids, GError **perror);
+gboolean e_mapi_connection_copy_items (EMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mids, GError **perror);
+gboolean e_mapi_connection_move_items (EMapiConnection *conn, mapi_id_t src_fid, guint32 src_fid_options, mapi_id_t dest_fid, guint32 dest_fid_options, GSList *mids, GError **perror);
+gboolean e_mapi_connection_get_folders_list (EMapiConnection *conn, GSList **mapi_folders, GError **perror);
+gboolean e_mapi_connection_get_pf_folders_list (EMapiConnection *conn, GSList **mapi_folders, GError **perror);
+GSList * e_mapi_connection_peek_folders_list (EMapiConnection *conn);
+
+gboolean e_mapi_connection_resolve_named_props (EMapiConnection *conn, mapi_id_t fid, ResolveNamedIDsData *named_ids_list, guint named_ids_n_elems, GError **perror);
+uint32_t e_mapi_connection_resolve_named_prop (EMapiConnection *conn, mapi_id_t fid, uint32_t pidlid_propid, GError **perror);
+uint32_t e_mapi_connection_unresolve_proptag_to_nameid (EMapiConnection *conn, mapi_id_t fid, uint32_t proptag);
+
+gchar * e_mapi_connection_ex_to_smtp (EMapiConnection *conn, const gchar *ex_address, gchar **display_name, GError **perror);
+
+/* Push notifications APIs */
+typedef gboolean (*exchange_check_continue) (void);
+
+gboolean e_mapi_connection_events_init (EMapiConnection *conn, GError **perror);
+gboolean e_mapi_connection_events_monitor (EMapiConnection *conn, struct mapi_notify_continue_callback_data *cb_data);
+
+gboolean e_mapi_connection_events_subscribe (EMapiConnection *conn, guint32 options,
+ guint16 event_mask, guint32 *events_conn_id,
+ mapi_notify_callback_t callback, gpointer data, GError **perror);
+
+gboolean e_mapi_connection_events_subscribe_and_monitor (EMapiConnection *conn, mapi_id_t *obj_id, guint32 options,
+ guint16 event_mask, guint32 *events_conn_id,
+ gboolean use_store, mapi_notify_callback_t callback,
+ gpointer data);
+
+gboolean e_mapi_connection_events_unsubscribe (EMapiConnection *conn, guint32 events_conn_id, GError **perror);
+
+/* profile functions */
+
+typedef struct {
+ const gchar *username;
+ gchar *password;
+ const gchar *domain;
+ const gchar *server;
+ gboolean use_ssl;
+ gboolean krb_sso;
+ const gchar *krb_realm;
+} EMapiProfileData;
+
+#define COMPLETE_PROFILEDATA(x) \
+ ((x)->username && *(x)->username && (x)->server && *(x)->server \
+ && (((x)->domain && *(x)->domain && (x)->password && *(x)->password) \
+ || ((x)->krb_sso && (x)->krb_realm && *(x)->krb_realm)))
+
+gboolean e_mapi_create_profile (EMapiProfileData *profile,
+ mapi_profile_callback_t cb, gconstpointer data, GError **perror);
+
+gboolean e_mapi_delete_profile (const gchar *profile, GError **perror);
+void e_mapi_rename_profile (const gchar *old_name, const gchar *new_name);
+
+/* utility functions */
+
+void make_mapi_error (GError **perror, const gchar *context, enum MAPISTATUS mapi_status);
+
+G_END_DECLS
+
+#endif
diff --git a/src/libexchangemapi/exchange-mapi-debug.c b/src/libexchangemapi/e-mapi-debug.c
similarity index 98%
rename from src/libexchangemapi/exchange-mapi-debug.c
rename to src/libexchangemapi/e-mapi-debug.c
index 244fdd9..dc85851 100644
--- a/src/libexchangemapi/exchange-mapi-debug.c
+++ b/src/libexchangemapi/e-mapi-debug.c
@@ -19,10 +19,10 @@
#include <stdarg.h>
-#include "exchange-mapi-debug.h"
+#include "e-mapi-debug.h"
gboolean
-exchange_mapi_debug_is_enabled (void)
+e_mapi_debug_is_enabled (void)
{
static gchar enabled = -1;
@@ -33,13 +33,13 @@ exchange_mapi_debug_is_enabled (void)
}
void
-exchange_mapi_debug_print (const gchar *format, ...)
+e_mapi_debug_print (const gchar *format, ...)
{
va_list args;
g_return_if_fail (format != NULL);
- if (!exchange_mapi_debug_is_enabled ())
+ if (!e_mapi_debug_is_enabled ())
return;
va_start (args, format);
@@ -110,10 +110,10 @@ dump_bin (const uint8_t *bin, uint32_t bin_sz, gint indent)
}
static const gchar *
-get_namedid_name (ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t proptag)
+get_namedid_name (EMapiConnection *conn, mapi_id_t fid, uint32_t proptag)
{
if (conn)
- proptag = exchange_mapi_connection_unresolve_proptag_to_nameid (conn, fid, proptag);
+ proptag = e_mapi_connection_unresolve_proptag_to_nameid (conn, fid, proptag);
if (proptag == MAPI_E_RESERVED)
return NULL;
@@ -706,7 +706,7 @@ get_namedid_name (ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t proptag)
}
void
-exchange_mapi_debug_dump_properties (ExchangeMapiConnection *conn, mapi_id_t fid, struct mapi_SPropValue_array *properties, gint indent)
+e_mapi_debug_dump_properties (EMapiConnection *conn, mapi_id_t fid, struct mapi_SPropValue_array *properties, gint indent)
{
gint i = 0;
diff --git a/src/libexchangemapi/exchange-mapi-debug.h b/src/libexchangemapi/e-mapi-debug.h
similarity index 67%
rename from src/libexchangemapi/exchange-mapi-debug.h
rename to src/libexchangemapi/e-mapi-debug.h
index 8d00be8..8bb964e 100644
--- a/src/libexchangemapi/exchange-mapi-debug.h
+++ b/src/libexchangemapi/e-mapi-debug.h
@@ -19,17 +19,17 @@
/* debugging stuff for evolution-mapi */
-#ifndef EXCHANGE_MAPI_DEBUG_H
-#define EXCHANGE_MAPI_DEBUG_H
+#ifndef E_MAPI_DEBUG_H
+#define E_MAPI_DEBUG_H
-#include "exchange-mapi-connection.h"
+#include "e-mapi-connection.h"
G_BEGIN_DECLS
-gboolean exchange_mapi_debug_is_enabled (void);
-void exchange_mapi_debug_print (const gchar *format, ...);
-void exchange_mapi_debug_dump_properties (ExchangeMapiConnection *conn, mapi_id_t fid, struct mapi_SPropValue_array *properties, gint indent);
+gboolean e_mapi_debug_is_enabled (void);
+void e_mapi_debug_print (const gchar *format, ...);
+void e_mapi_debug_dump_properties (EMapiConnection *conn, mapi_id_t fid, struct mapi_SPropValue_array *properties, gint indent);
G_END_DECLS
-#endif /* EXCHANGE_MAPI_DEBUG_H */
+#endif /* E_MAPI_DEBUG_H */
diff --git a/src/libexchangemapi/exchange-mapi-defs.h b/src/libexchangemapi/e-mapi-defs.h
similarity index 98%
rename from src/libexchangemapi/exchange-mapi-defs.h
rename to src/libexchangemapi/e-mapi-defs.h
index 751505d..78f1f45 100644
--- a/src/libexchangemapi/exchange-mapi-defs.h
+++ b/src/libexchangemapi/e-mapi-defs.h
@@ -25,8 +25,10 @@
/* 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
+#ifndef E_MAPI_DEFS_H
+#define E_MAPI_DEFS_H
+
+#include <glib.h>
G_BEGIN_DECLS
diff --git a/src/libexchangemapi/e-mapi-fast-transfer.c b/src/libexchangemapi/e-mapi-fast-transfer.c
index 2193eae..38075d0 100644
--- a/src/libexchangemapi/e-mapi-fast-transfer.c
+++ b/src/libexchangemapi/e-mapi-fast-transfer.c
@@ -25,8 +25,8 @@
#include <config.h>
#endif
-#include "exchange-mapi-connection.h"
-#include "exchange-mapi-debug.h"
+#include "e-mapi-connection.h"
+#include "e-mapi-debug.h"
#include "e-mapi-fast-transfer.h"
#include "e-mapi-openchange.h"
@@ -35,7 +35,7 @@ struct _EMapiFXParserClosure;
typedef struct _EMapiFXParserClosure EMapiFXParserClosure;
struct _EMapiFXParserClosure {
- ExchangeMapiConnection *conn;
+ EMapiConnection *conn;
mapi_id_t fid;
TALLOC_CTX *mem_ctx;
EMapiFastTransferCB cb;
@@ -202,18 +202,18 @@ e_mapi_message_dump (EMapiMessage *message, gint indent, gboolean with_propertie
return;
if (with_properties)
- exchange_mapi_debug_dump_properties (NULL, 0, &message->properties, indent + 3);
+ e_mapi_debug_dump_properties (NULL, 0, &message->properties, indent + 3);
for (index = 0, recipient = message->recipients; recipient; index++, recipient = recipient->next) {
g_print ("%*sRecipient[%d]:\n", indent + 2, "", index);
if (with_properties)
- exchange_mapi_debug_dump_properties (NULL, 0, &recipient->properties, indent + 3);
+ e_mapi_debug_dump_properties (NULL, 0, &recipient->properties, indent + 3);
}
for (index = 0, attachment = message->attachments; attachment; index++, attachment = attachment->next) {
g_print ("%*sAttachment[%d]:\n", indent + 2, "", index);
if (with_properties)
- exchange_mapi_debug_dump_properties (NULL, 0, &attachment->properties, indent + 3);
+ e_mapi_debug_dump_properties (NULL, 0, &attachment->properties, indent + 3);
if (attachment->embeded_message) {
g_print ("%*sEmbeded message:\n", indent + 3, "");
e_mapi_message_dump (attachment->embeded_message, indent + 5, with_properties);
@@ -443,7 +443,7 @@ parse_property_cb (struct SPropValue prop, void *closure)
}
static enum MAPISTATUS
-e_mapi_fast_transfer_internal (ExchangeMapiConnection *conn,
+e_mapi_fast_transfer_internal (EMapiConnection *conn,
mapi_id_t fid,
TALLOC_CTX *mem_ctx,
EMapiFastTransferCB cb,
@@ -514,7 +514,7 @@ e_mapi_fast_transfer_internal (ExchangeMapiConnection *conn,
}
enum MAPISTATUS
-e_mapi_fast_transfer_objects (ExchangeMapiConnection *conn,
+e_mapi_fast_transfer_objects (EMapiConnection *conn,
mapi_id_t fid,
TALLOC_CTX *mem_ctx,
mapi_object_t *obj_folder,
@@ -544,7 +544,7 @@ e_mapi_fast_transfer_objects (ExchangeMapiConnection *conn,
}
enum MAPISTATUS
-e_mapi_fast_transfer_object (ExchangeMapiConnection *conn,
+e_mapi_fast_transfer_object (EMapiConnection *conn,
mapi_id_t fid,
TALLOC_CTX *mem_ctx,
mapi_object_t *obj_message,
diff --git a/src/libexchangemapi/e-mapi-fast-transfer.h b/src/libexchangemapi/e-mapi-fast-transfer.h
index ef652e9..5f37fd6 100644
--- a/src/libexchangemapi/e-mapi-fast-transfer.h
+++ b/src/libexchangemapi/e-mapi-fast-transfer.h
@@ -28,7 +28,7 @@
#include <glib-object.h>
#include <libmapi/libmapi.h>
-#include "exchange-mapi-connection.h"
+#include "e-mapi-connection.h"
G_BEGIN_DECLS
@@ -40,7 +40,7 @@ typedef struct _EMapiMessage EMapiMessage;
typedef struct _EMapiRecipient EMapiRecipient;
typedef struct _EMapiAttachment EMapiAttachment;
-typedef gboolean (*EMapiFastTransferCB) (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, /* const */ EMapiMessage *message, guint32 msg_index, guint32 msg_total, gpointer user_data, GError **perror);
+typedef gboolean (*EMapiFastTransferCB) (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, /* const */ EMapiMessage *message, guint32 msg_index, guint32 msg_total, gpointer user_data, GError **perror);
struct _EMapiRecipient
{
@@ -77,7 +77,7 @@ void e_mapi_message_dump (EMapiMessage *message,
gint indent,
gboolean with_properties);
-enum MAPISTATUS e_mapi_fast_transfer_objects (ExchangeMapiConnection *conn,
+enum MAPISTATUS e_mapi_fast_transfer_objects (EMapiConnection *conn,
mapi_id_t fid,
TALLOC_CTX *mem_ctx,
mapi_object_t *obj_folder,
@@ -93,7 +93,7 @@ typedef enum {
E_MAPI_FAST_TRANSFER_FLAG_ALL = E_MAPI_FAST_TRANSFER_FLAG_ATTACHMENTS | E_MAPI_FAST_TRANSFER_FLAG_RECIPIENTS
} EMapiFastTransferFlags;
-enum MAPISTATUS e_mapi_fast_transfer_object (ExchangeMapiConnection *conn,
+enum MAPISTATUS e_mapi_fast_transfer_object (EMapiConnection *conn,
mapi_id_t fid,
TALLOC_CTX *mem_ctx,
mapi_object_t *obj_message,
diff --git a/src/libexchangemapi/exchange-mapi-folder.c b/src/libexchangemapi/e-mapi-folder.c
similarity index 67%
rename from src/libexchangemapi/exchange-mapi-folder.c
rename to src/libexchangemapi/e-mapi-folder.c
index 794bbf2..babebfb 100644
--- a/src/libexchangemapi/exchange-mapi-folder.c
+++ b/src/libexchangemapi/e-mapi-folder.c
@@ -25,15 +25,15 @@
#include <config.h>
#endif
-#include "exchange-mapi-connection.h"
-#include "exchange-mapi-folder.h"
+#include "e-mapi-connection.h"
+#include "e-mapi-folder.h"
#define d(x)
-static ExchangeMAPIFolderType
+static EMapiFolderType
container_class_to_type (const gchar *type)
{
- ExchangeMAPIFolderType folder_type = MAPI_FOLDER_TYPE_UNKNOWN;;
+ EMapiFolderType folder_type = MAPI_FOLDER_TYPE_UNKNOWN;;
if (!strcmp (type, IPF_APPOINTMENT))
folder_type = MAPI_FOLDER_TYPE_APPOINTMENT;
@@ -54,12 +54,12 @@ container_class_to_type (const gchar *type)
return folder_type;
}
-ExchangeMAPIFolder *
-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)
+EMapiFolder *
+e_mapi_folder_new (const gchar *folder_name, const gchar *container_class, EMapiFolderCategory 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;
+ EMapiFolder *folder;
- folder = g_new0 (ExchangeMAPIFolder, 1);
+ folder = g_new0 (EMapiFolder, 1);
folder->is_default = FALSE;
folder->folder_name = g_strdup (folder_name);
folder->container_class = container_class_to_type (container_class);
@@ -73,14 +73,14 @@ exchange_mapi_folder_new (const gchar *folder_name, const gchar *container_class
return folder;
}
-ExchangeMAPIFolder *
-exchange_mapi_folder_copy (ExchangeMAPIFolder *src)
+EMapiFolder *
+e_mapi_folder_copy (EMapiFolder *src)
{
- ExchangeMAPIFolder *res;
+ EMapiFolder *res;
g_return_val_if_fail (src != NULL, NULL);
- res = g_new0 (ExchangeMAPIFolder, 1);
+ res = g_new0 (EMapiFolder, 1);
*res = *src;
res->owner_name = g_strdup (src->owner_name);
@@ -93,7 +93,7 @@ exchange_mapi_folder_copy (ExchangeMAPIFolder *src)
}
void
-exchange_mapi_folder_free (ExchangeMAPIFolder *folder)
+e_mapi_folder_free (EMapiFolder *folder)
{
if (folder) {
g_free (folder->folder_name);
@@ -101,70 +101,70 @@ exchange_mapi_folder_free (ExchangeMAPIFolder *folder)
}
}
-ExchangeMAPIFolderType
-exchange_mapi_container_class (gchar *type)
+EMapiFolderType
+e_mapi_container_class (gchar *type)
{
return container_class_to_type (type);
}
const gchar *
-exchange_mapi_folder_get_name (ExchangeMAPIFolder *folder)
+e_mapi_folder_get_name (EMapiFolder *folder)
{
return folder->folder_name;
}
guint64
-exchange_mapi_folder_get_fid (ExchangeMAPIFolder *folder)
+e_mapi_folder_get_fid (EMapiFolder *folder)
{
return folder->folder_id;
}
guint64
-exchange_mapi_folder_get_parent_id (ExchangeMAPIFolder *folder)
+e_mapi_folder_get_parent_id (EMapiFolder *folder)
{
return folder->parent_folder_id;
}
gboolean
-exchange_mapi_folder_is_root (ExchangeMAPIFolder *folder)
+e_mapi_folder_is_root (EMapiFolder *folder)
{
return (folder->parent_folder_id == 0);
}
-ExchangeMAPIFolderType
-exchange_mapi_folder_get_type (ExchangeMAPIFolder *folder)
+EMapiFolderType
+e_mapi_folder_get_type (EMapiFolder *folder)
{
return folder->container_class;
}
guint32
-exchange_mapi_folder_get_unread_count (ExchangeMAPIFolder *folder)
+e_mapi_folder_get_unread_count (EMapiFolder *folder)
{
return folder->unread_count;
}
guint32
-exchange_mapi_folder_get_total_count (ExchangeMAPIFolder *folder)
+e_mapi_folder_get_total_count (EMapiFolder *folder)
{
return folder->total;
}
GSList *
-exchange_mapi_folder_copy_list (GSList *folder_list)
+e_mapi_folder_copy_list (GSList *folder_list)
{
GSList *res, *ii;
res = g_slist_copy (folder_list);
for (ii = res; ii; ii = ii->next) {
- ii->data = exchange_mapi_folder_copy (ii->data);
+ ii->data = e_mapi_folder_copy (ii->data);
}
return res;
}
void
-exchange_mapi_folder_free_list (GSList *folder_list)
+e_mapi_folder_free_list (GSList *folder_list)
{
- g_slist_foreach (folder_list, (GFunc) exchange_mapi_folder_free, NULL);
+ g_slist_foreach (folder_list, (GFunc) e_mapi_folder_free, NULL);
g_slist_free (folder_list);
}
diff --git a/src/libexchangemapi/exchange-mapi-folder.h b/src/libexchangemapi/e-mapi-folder.h
similarity index 56%
rename from src/libexchangemapi/exchange-mapi-folder.h
rename to src/libexchangemapi/e-mapi-folder.h
index 6c4a769..a0fa528 100644
--- a/src/libexchangemapi/exchange-mapi-folder.h
+++ b/src/libexchangemapi/e-mapi-folder.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef EXCHANGE_MAPI_FOLDER_H
-#define EXCHANGE_MAPI_FOLDER_H
+#ifndef E_MAPI_FOLDER_H
+#define E_MAPI_FOLDER_H
#include <glib.h>
@@ -37,15 +37,15 @@ typedef enum {
MAPI_FOLDER_TYPE_TASK,
MAPI_FOLDER_TYPE_NOTE_HOMEPAGE,
MAPI_FOLDER_TYPE_UNKNOWN
-} ExchangeMAPIFolderType;
+} EMapiFolderType;
typedef enum {
MAPI_PERSONAL_FOLDER,
MAPI_FAVOURITE_FOLDER,
MAPI_FOREIGN_FOLDER
-} ExchangeMAPIFolderCategory;
+} EMapiFolderCategory;
-typedef struct _ExchangeMAPIFolder {
+typedef struct _EMapiFolder {
/* We'll need this separation of 'owner' and 'user' when we do delegation */
gchar *owner_name;
gchar *owner_email;
@@ -57,8 +57,8 @@ typedef struct _ExchangeMAPIFolder {
guint32 default_type;
gchar *folder_name;
- ExchangeMAPIFolderType container_class;
- ExchangeMAPIFolderCategory category;
+ EMapiFolderType container_class;
+ EMapiFolderCategory category;
mapi_id_t folder_id;
mapi_id_t parent_folder_id;
guint32 child_count;
@@ -70,26 +70,29 @@ typedef struct _ExchangeMAPIFolder {
gpointer reserved1;
gpointer reserved2;
gpointer reserved3;
-} ExchangeMAPIFolder;
+} EMapiFolder;
-ExchangeMAPIFolder *
-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);
-ExchangeMAPIFolder *exchange_mapi_folder_copy (ExchangeMAPIFolder *src);
-void exchange_mapi_folder_free (ExchangeMAPIFolder *folder);
-ExchangeMAPIFolderType exchange_mapi_container_class (gchar *type);
+EMapiFolder * e_mapi_folder_new (const gchar *folder_name,
+ const gchar *container_class,
+ EMapiFolderCategory catgory,
+ mapi_id_t folder_id,
+ mapi_id_t parent_folder_id,
+ uint32_t child_count,
+ uint32_t unread_count,
+ uint32_t total);
+EMapiFolder * e_mapi_folder_copy (EMapiFolder *src);
+void e_mapi_folder_free (EMapiFolder *folder);
+EMapiFolderType e_mapi_container_class (gchar *type);
-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);
-guint32 exchange_mapi_folder_get_unread_count (ExchangeMAPIFolder *folder);
-guint32 exchange_mapi_folder_get_total_count (ExchangeMAPIFolder *folder);
-gboolean exchange_mapi_folder_is_root (ExchangeMAPIFolder *folder);
+const gchar * e_mapi_folder_get_name (EMapiFolder *folder);
+mapi_id_t e_mapi_folder_get_fid (EMapiFolder *folder);
+mapi_id_t e_mapi_folder_get_parent_id (EMapiFolder *folder);
+EMapiFolderType e_mapi_folder_get_type (EMapiFolder *folder);
+guint32 e_mapi_folder_get_unread_count (EMapiFolder *folder);
+guint32 e_mapi_folder_get_total_count (EMapiFolder *folder);
+gboolean e_mapi_folder_is_root (EMapiFolder *folder);
-GSList *exchange_mapi_folder_copy_list (GSList *folder_list);
-void exchange_mapi_folder_free_list (GSList *folder_list);
+GSList * e_mapi_folder_copy_list (GSList *folder_list);
+void e_mapi_folder_free_list (GSList *folder_list);
#endif
diff --git a/src/libexchangemapi/exchange-mapi-mail-utils.c b/src/libexchangemapi/e-mapi-mail-utils.c
similarity index 92%
rename from src/libexchangemapi/exchange-mapi-mail-utils.c
rename to src/libexchangemapi/e-mapi-mail-utils.c
index 4809eb6..3336c2a 100644
--- a/src/libexchangemapi/exchange-mapi-mail-utils.c
+++ b/src/libexchangemapi/e-mapi-mail-utils.c
@@ -23,10 +23,10 @@
#include <camel/camel.h>
-#include "exchange-mapi-defs.h"
-#include "exchange-mapi-utils.h"
-#include "exchange-mapi-cal-utils.h"
-#include "exchange-mapi-mail-utils.h"
+#include "e-mapi-defs.h"
+#include "e-mapi-utils.h"
+#include "e-mapi-cal-utils.h"
+#include "e-mapi-mail-utils.h"
extern gint camel_application_is_exiting;
@@ -46,9 +46,9 @@ mail_item_free (MailItem *item)
g_free (item->header.content_class);
g_free (item->header.transport_headers);
- exchange_mapi_util_free_attachment_list (&item->attachments);
- exchange_mapi_util_free_stream_list (&item->generic_streams);
- exchange_mapi_util_free_recipient_list (&item->recipients);
+ e_mapi_util_free_attachment_list (&item->attachments);
+ e_mapi_util_free_stream_list (&item->generic_streams);
+ e_mapi_util_free_recipient_list (&item->recipients);
g_free (item->msg_class);
g_free (item->pid_name_content_type);
@@ -73,11 +73,11 @@ fetch_props_to_mail_item_cb (FetchItemsCallbackData *item_data, gpointer data)
g_return_val_if_fail (data != NULL, FALSE);
if (camel_debug_start("mapi:folder")) {
- exchange_mapi_debug_dump_properties (item_data->conn, item_data->fid, item_data->properties, 3);
+ e_mapi_debug_dump_properties (item_data->conn, item_data->fid, item_data->properties, 3);
camel_debug_end();
}
- content_class_pid = exchange_mapi_connection_resolve_named_prop (item_data->conn, item_data->fid, PidNameContentClass, NULL);
+ content_class_pid = e_mapi_connection_resolve_named_prop (item_data->conn, item_data->fid, PidNameContentClass, NULL);
if (content_class_pid == MAPI_E_RESERVED)
content_class_pid = 0;
@@ -118,7 +118,7 @@ fetch_props_to_mail_item_cb (FetchItemsCallbackData *item_data, gpointer data)
item->is_cal = FALSE;
if (msg_class && g_str_has_prefix (msg_class, IPM_SCHEDULE_MEETING_PREFIX)) {
- guint8 *appointment_body_str = (guint8 *) exchange_mapi_cal_util_camel_helper (item_data->conn, item_data->fid, item_data->mid, NULL, msg_class,
+ guint8 *appointment_body_str = (guint8 *) e_mapi_cal_util_camel_helper (item_data->conn, item_data->fid, item_data->mid, NULL, msg_class,
item_data->streams, item_data->recipients, item_data->attachments);
if (appointment_body_str && *appointment_body_str) {
@@ -136,19 +136,19 @@ fetch_props_to_mail_item_cb (FetchItemsCallbackData *item_data, gpointer data)
if (!item->is_cal) {
/* always prefer unicode version, as that can be properly read */
- if (!(body = exchange_mapi_util_find_stream (item_data->streams, PR_BODY_UNICODE)))
- body = exchange_mapi_util_find_stream (item_data->streams, PR_BODY);
+ if (!(body = e_mapi_util_find_stream (item_data->streams, PR_BODY_UNICODE)))
+ body = e_mapi_util_find_stream (item_data->streams, PR_BODY);
if (body)
item->msg.body_parts = g_slist_append (item->msg.body_parts, body);
- body = exchange_mapi_util_find_stream (item_data->streams, PR_HTML);
+ body = e_mapi_util_find_stream (item_data->streams, PR_HTML);
if (body)
item->msg.body_parts = g_slist_append (item->msg.body_parts, body);
}
if (delivery_date) {
- item->header.recieved_time = exchange_mapi_util_filetime_to_time_t (delivery_date);
+ item->header.recieved_time = e_mapi_util_filetime_to_time_t (delivery_date);
}
if (flags && (*flags & MSGFLAG_READ) != 0)
@@ -251,7 +251,7 @@ fetch_read_item_common_data (MailItem *item, uint32_t propTag, gconstpointer pro
}
gboolean
-mapi_mail_get_item_prop_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
+mapi_mail_get_item_prop_list (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data)
{
static const uint32_t item_props[] = {
PR_FID,
@@ -311,10 +311,10 @@ mapi_mail_get_item_prop_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALLO
g_return_val_if_fail (props != NULL, FALSE);
- if (!exchange_mapi_utils_add_props_to_props_array (mem_ctx, props, item_props, G_N_ELEMENTS (item_props)))
+ if (!e_mapi_utils_add_props_to_props_array (mem_ctx, props, item_props, G_N_ELEMENTS (item_props)))
return FALSE;
- return exchange_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
+ return e_mapi_utils_add_named_ids_to_props_array (conn, fid, mem_ctx, props, nids, G_N_ELEMENTS (nids));
}
static gboolean
@@ -335,7 +335,7 @@ name_is_email_user (const gchar *name, const gchar *email_id)
}
static void
-mapi_mime_set_recipient_list (ExchangeMapiConnection *conn, CamelMimeMessage *msg, MailItem *item)
+mapi_mime_set_recipient_list (EMapiConnection *conn, CamelMimeMessage *msg, MailItem *item)
{
GSList *l = NULL;
CamelInternetAddress *to_addr, *cc_addr, *bcc_addr;
@@ -360,19 +360,19 @@ mapi_mime_set_recipient_list (ExchangeMapiConnection *conn, CamelMimeMessage *ms
/*Name is probably available in one of these props.*/
name = recip->display_name;
- name = name ? name : exchange_mapi_util_find_row_propval (aRow, PR_DISPLAY_NAME_UNICODE);
- name = name ? name : exchange_mapi_util_find_row_propval (aRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
+ name = name ? name : e_mapi_util_find_row_propval (aRow, PR_DISPLAY_NAME_UNICODE);
+ name = name ? name : e_mapi_util_find_row_propval (aRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
if (!name) {
- name = exchange_mapi_util_find_row_propval (aRow, PR_7BIT_DISPLAY_NAME_UNICODE);
+ name = e_mapi_util_find_row_propval (aRow, PR_7BIT_DISPLAY_NAME_UNICODE);
if (name && !strchr (name, '@')) {
gchar *to_free;
- to_free = exchange_mapi_connection_ex_to_smtp (conn, recip->email_id, &display_name, NULL);
+ to_free = e_mapi_connection_ex_to_smtp (conn, recip->email_id, &display_name, NULL);
g_free (to_free);
}
}
- type = (uint32_t *) exchange_mapi_util_find_row_propval (aRow, PR_RECIPIENT_TYPE);
+ type = (uint32_t *) e_mapi_util_find_row_propval (aRow, PR_RECIPIENT_TYPE);
if (!display_name && name && (!recip->email_id || !name_is_email_user (name, recip->email_id)))
display_name = g_strdup (name);
@@ -422,7 +422,7 @@ mapi_mime_set_recipient_list (ExchangeMapiConnection *conn, CamelMimeMessage *ms
}
static void
-mapi_mime_set_msg_headers (ExchangeMapiConnection *conn, CamelMimeMessage *msg, MailItem *item)
+mapi_mime_set_msg_headers (EMapiConnection *conn, CamelMimeMessage *msg, MailItem *item)
{
gchar *temp_str = NULL;
time_t recieved_time;
@@ -480,7 +480,7 @@ mapi_mime_set_msg_headers (ExchangeMapiConnection *conn, CamelMimeMessage *msg,
if ((item->header.from_type != NULL) && !g_utf8_collate (item->header.from_type, "EX")) {
gchar *from_email;
- from_email = exchange_mapi_connection_ex_to_smtp (conn, item->header.from_email, NULL, NULL);
+ from_email = e_mapi_connection_ex_to_smtp (conn, item->header.from_email, NULL, NULL);
g_free (item->header.from_email);
item->header.from_email = from_email;
}
@@ -675,7 +675,7 @@ static gboolean
is_apple_attachment (ExchangeMAPIAttachment *attach, guint32 *data_len, guint32 *resource_len)
{
gboolean is_apple = FALSE;
- ExchangeMAPIStream *enc_stream = exchange_mapi_util_find_stream (attach->streams, PR_ATTACH_ENCODING);
+ ExchangeMAPIStream *enc_stream = e_mapi_util_find_stream (attach->streams, PR_ATTACH_ENCODING);
guint8 apple_enc_magic[] = { 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x14, 0x03, 0x0B, 0x01 };
if (enc_stream && enc_stream->value && enc_stream->value->len == G_N_ELEMENTS (apple_enc_magic)) {
@@ -686,7 +686,7 @@ is_apple_attachment (ExchangeMAPIAttachment *attach, guint32 *data_len, guint32
is_apple = apple_enc_magic[idx] == enc_stream->value->data[idx];
}
} else {
- const struct Binary_r *bin = exchange_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_ENCODING);
+ const struct Binary_r *bin = e_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_ENCODING);
if (bin && bin->cb == G_N_ELEMENTS (apple_enc_magic)) {
gint idx;
@@ -699,7 +699,7 @@ is_apple_attachment (ExchangeMAPIAttachment *attach, guint32 *data_len, guint32
if (is_apple) {
/* check boundaries too */
- ExchangeMAPIStream *data_stream = exchange_mapi_util_find_stream (attach->streams, PR_ATTACH_DATA_BIN);
+ ExchangeMAPIStream *data_stream = e_mapi_util_find_stream (attach->streams, PR_ATTACH_DATA_BIN);
is_apple = data_stream && data_stream->value && data_stream->value->len > 128;
@@ -721,7 +721,7 @@ is_apple_attachment (ExchangeMAPIAttachment *attach, guint32 *data_len, guint32
/*Takes raw attachment streams and converts to MIME Parts. Parts are added to
either inline / non-inline lists.*/
static void
-mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, const gchar *msg_class, GSList *attachments, GSList **inline_attachs, GSList **noninline)
+mapi_mime_classify_attachments (EMapiConnection *conn, mapi_id_t fid, const gchar *msg_class, GSList *attachments, GSList **inline_attachs, GSList **noninline)
{
/* SMIME encrypted are without ending dot */
gboolean is_smime = msg_class && strstr (msg_class, ".SMIME.") > msg_class;
@@ -736,7 +736,7 @@ mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, con
gboolean is_apple;
guint32 apple_data_len = 0, apple_resource_len = 0;
- stream = exchange_mapi_util_find_stream (attach->streams, PR_ATTACH_DATA_BIN);
+ stream = e_mapi_util_find_stream (attach->streams, PR_ATTACH_DATA_BIN);
if (!stream || stream->value->len <= 0) {
continue;
@@ -745,11 +745,11 @@ mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, con
is_apple = is_apple_attachment (attach, &apple_data_len, &apple_resource_len);
/*Content-Type*/
- ui32 = (const uint32_t *) exchange_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_METHOD);
+ ui32 = (const uint32_t *) e_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_METHOD);
if (ui32 && *ui32 == ATTACH_EMBEDDED_MSG) {
mime_type = "message/rfc822";
} else {
- mime_type = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_MIME_TAG);
+ mime_type = (const gchar *) e_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_MIME_TAG);
if (!mime_type)
mime_type = "application/octet-stream";
}
@@ -762,11 +762,11 @@ mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, con
part = camel_mime_part_new ();
- filename = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps,
+ filename = (const gchar *) e_mapi_util_find_SPropVal_array_propval(attach->lpProps,
PR_ATTACH_LONG_FILENAME_UNICODE);
if (!(filename && *filename))
- filename = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps,
+ filename = (const gchar *) e_mapi_util_find_SPropVal_array_propval(attach->lpProps,
PR_ATTACH_FILENAME_UNICODE);
camel_mime_part_set_filename (part, filename);
camel_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "name", filename);
@@ -784,11 +784,11 @@ mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, con
camel_mime_part_set_encoding (part, CAMEL_TRANSFER_ENCODING_BASE64);
strm = NULL;
- proptag = exchange_mapi_connection_resolve_named_prop (conn, fid, PidNameAttachmentMacInfo, NULL);
+ proptag = e_mapi_connection_resolve_named_prop (conn, fid, PidNameAttachmentMacInfo, NULL);
if (proptag != MAPI_E_RESERVED)
- strm = exchange_mapi_util_find_stream (attach->streams, proptag);
+ strm = e_mapi_util_find_stream (attach->streams, proptag);
if (!strm)
- strm = exchange_mapi_util_find_stream (attach->streams, PidNameAttachmentMacInfo);
+ strm = e_mapi_util_find_stream (attach->streams, PidNameAttachmentMacInfo);
if (strm && strm->value && strm->value->len > 0) {
camel_mime_part_set_content (part, (const gchar *) strm->value->data, strm->value->len, mime_type);
@@ -828,7 +828,7 @@ mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, con
camel_mime_part_set_filename (part, (apple_filename && *apple_filename) ? apple_filename : filename);
g_free (apple_filename);
- mime_type = exchange_mapi_util_find_SPropVal_array_namedid (attach->lpProps, conn, fid, PidNameAttachmentMacContentType);
+ mime_type = e_mapi_util_find_SPropVal_array_namedid (attach->lpProps, conn, fid, PidNameAttachmentMacContentType);
if (!mime_type)
mime_type = "application/octet-stream";
@@ -879,7 +879,7 @@ mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, con
}
/*Content-ID*/
- content_id = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps,
+ content_id = (const gchar *) e_mapi_util_find_SPropVal_array_propval(attach->lpProps,
PR_ATTACH_CONTENT_ID);
/* TODO : Add disposition */
if (content_id && !is_apple && !is_smime) {
@@ -891,7 +891,7 @@ mapi_mime_classify_attachments (ExchangeMapiConnection *conn, mapi_id_t fid, con
}
CamelMimeMessage *
-mapi_mail_item_to_mime_message (ExchangeMapiConnection *conn, MailItem *item)
+mapi_mail_item_to_mime_message (EMapiConnection *conn, MailItem *item)
{
CamelMimeMessage *msg = NULL;
CamelMultipart *multipart_body = NULL;
@@ -986,7 +986,7 @@ mail_item_add_recipient (const gchar *recipients, OlMailRecipientType type, GSLi
recipient->email_id = recipients;
/* this memory should be freed somewhere, perhaps in the existing
- * exchange_mapi_util_free_recipient_list() */
+ * e_mapi_util_free_recipient_list() */
recipient->in.req_cValues = 2;
recipient->in.req_lpProps = g_new0 (struct SPropValue, recipient->in.req_cValues + 1);
@@ -1603,7 +1603,7 @@ mapi_mime_message_to_mail_item (CamelMimeMessage *message, gint32 message_camel_
}
gboolean
-mapi_mail_utils_create_item_build_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data)
+mapi_mail_utils_create_item_build_props (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data)
{
MailItem *item = (MailItem *) data;
@@ -1612,7 +1612,7 @@ mapi_mail_utils_create_item_build_props (ExchangeMapiConnection *conn, mapi_id_t
uint32_t cpid;
#define set_value(hex, val) G_STMT_START { \
- if (!exchange_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, val)) \
+ if (!e_mapi_utils_add_spropvalue (mem_ctx, values, n_values, hex, val)) \
return FALSE; \
} G_STMT_END
@@ -1621,7 +1621,7 @@ mapi_mail_utils_create_item_build_props (ExchangeMapiConnection *conn, mapi_id_t
}
if (item->pid_name_content_type) {
- if (!exchange_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, PidNameContentType, item->pid_name_content_type))
+ if (!e_mapi_utils_add_spropvalue_namedid (conn, fid, mem_ctx, values, n_values, PidNameContentType, item->pid_name_content_type))
return FALSE;
}
@@ -1647,7 +1647,7 @@ mapi_mail_utils_create_item_build_props (ExchangeMapiConnection *conn, mapi_id_t
if (item->header.recieved_time != 0) {
struct FILETIME msg_date = { 0 };
- exchange_mapi_util_time_t_to_filetime (item->header.recieved_time, &msg_date);
+ e_mapi_util_time_t_to_filetime (item->header.recieved_time, &msg_date);
set_value (PR_MESSAGE_DELIVERY_TIME, &msg_date);
}
diff --git a/src/libexchangemapi/exchange-mapi-mail-utils.h b/src/libexchangemapi/e-mapi-mail-utils.h
similarity index 80%
rename from src/libexchangemapi/exchange-mapi-mail-utils.h
rename to src/libexchangemapi/e-mapi-mail-utils.h
index c1f289b..8234afe 100644
--- a/src/libexchangemapi/exchange-mapi-mail-utils.h
+++ b/src/libexchangemapi/e-mapi-mail-utils.h
@@ -17,8 +17,8 @@
*
*/
-#ifndef EXCHANGE_MAPI_MAIL_UTILS_H
-#define EXCHANGE_MAPI_MAIL_UTILS_H
+#ifndef E_MAPI_MAIL_UTILS_H
+#define E_MAPI_MAIL_UTILS_H
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -29,7 +29,7 @@
#include <libmapi/libmapi.h>
-#include <exchange-mapi-connection.h>
+#include <e-mapi-connection.h>
typedef enum {
PART_TYPE_PLAIN_TEXT=1,
@@ -87,14 +87,14 @@ gboolean fetch_props_to_mail_item_cb (FetchItemsCallbackData *item_data, gpointe
/* returns TRUE when filled an entry in the MailItem based on the propTag and its value */
gboolean fetch_read_item_common_data (MailItem *item, uint32_t propTag, gconstpointer prop_data);
-gboolean mapi_mail_get_item_prop_list (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data);
+gboolean mapi_mail_get_item_prop_list (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, gpointer data);
struct _CamelMimeMessage;
-struct _CamelMimeMessage *mapi_mail_item_to_mime_message (ExchangeMapiConnection *conn, MailItem *item);
+struct _CamelMimeMessage *mapi_mail_item_to_mime_message (EMapiConnection *conn, MailItem *item);
struct _CamelAddress;
MailItem *mapi_mime_message_to_mail_item (struct _CamelMimeMessage *message, gint32 message_camel_flags, struct _CamelAddress *from, GCancellable *cancellable, GError **error);
/* uses MailItem * as 'data' pointer */
-gboolean mapi_mail_utils_create_item_build_props (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data);
+gboolean mapi_mail_utils_create_item_build_props (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values, uint32_t *n_values, gpointer data);
-#endif /* EXCHANGE_MAPI_MAIL_UTILS */
+#endif /* E_MAPI_MAIL_UTILS */
diff --git a/src/libexchangemapi/em-operation-queue.c b/src/libexchangemapi/e-mapi-operation-queue.c
similarity index 67%
rename from src/libexchangemapi/em-operation-queue.c
rename to src/libexchangemapi/e-mapi-operation-queue.c
index 7a3cb9d..328b379 100644
--- a/src/libexchangemapi/em-operation-queue.c
+++ b/src/libexchangemapi/e-mapi-operation-queue.c
@@ -23,7 +23,7 @@
#endif
#include <stdio.h>
-#include "em-operation-queue.h"
+#include "e-mapi-operation-queue.h"
static void thread_func_cb (gpointer data, gpointer pqueue);
@@ -32,29 +32,29 @@ static void thread_func_cb (gpointer data, gpointer pqueue);
/* GObject foo - begin */
-G_DEFINE_TYPE (EMOperationQueue, em_operation_queue, G_TYPE_OBJECT)
+G_DEFINE_TYPE (EMapiOperationQueue, e_mapi_operation_queue, G_TYPE_OBJECT)
-struct _EMOperationQueuePrivate
+struct _EMapiOperationQueuePrivate
{
GMutex *lock;
GThreadPool *pool;
- EMOperationQueueFunc worker_cb;
+ EMapiOperationQueueFunc worker_cb;
gpointer user_data;
GSList *ops;
};
static void
-em_operation_queue_dispose (GObject *object)
+e_mapi_operation_queue_dispose (GObject *object)
{
- EMOperationQueue *queue = EM_OPERATION_QUEUE (object);
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueue *queue = E_MAPI_OPERATION_QUEUE (object);
+ EMapiOperationQueuePrivate *priv;
g_return_if_fail (queue != NULL);
priv = queue->priv;
if (priv) {
- em_operation_queue_cancel_all (queue);
+ e_mapi_operation_queue_cancel_all (queue);
LOCK ();
if (priv->ops) {
@@ -70,30 +70,30 @@ em_operation_queue_dispose (GObject *object)
g_mutex_free (priv->lock);
}
- if (G_OBJECT_CLASS (em_operation_queue_parent_class)->dispose)
- G_OBJECT_CLASS (em_operation_queue_parent_class)->dispose (object);
+ if (G_OBJECT_CLASS (e_mapi_operation_queue_parent_class)->dispose)
+ G_OBJECT_CLASS (e_mapi_operation_queue_parent_class)->dispose (object);
}
static void
-em_operation_queue_class_init (EMOperationQueueClass *klass)
+e_mapi_operation_queue_class_init (EMapiOperationQueueClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (EMOperationQueuePrivate));
+ g_type_class_add_private (klass, sizeof (EMapiOperationQueuePrivate));
object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = em_operation_queue_dispose;
+ object_class->dispose = e_mapi_operation_queue_dispose;
}
static void
-em_operation_queue_init (EMOperationQueue *queue)
+e_mapi_operation_queue_init (EMapiOperationQueue *queue)
{
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueuePrivate *priv;
g_return_if_fail (queue != NULL);
- g_return_if_fail (EM_IS_OPERATION_QUEUE (queue));
+ g_return_if_fail (E_MAPI_IS_OPERATION_QUEUE (queue));
- queue->priv = G_TYPE_INSTANCE_GET_PRIVATE (queue, EM_TYPE_OPERATION_QUEUE, EMOperationQueuePrivate);
+ queue->priv = G_TYPE_INSTANCE_GET_PRIVATE (queue, E_MAPI_TYPE_OPERATION_QUEUE, EMapiOperationQueuePrivate);
priv = queue->priv;
g_return_if_fail (priv != NULL);
@@ -115,13 +115,13 @@ struct OPData
static void
thread_func_cb (gpointer data, gpointer pqueue)
{
- EMOperationQueue *queue = pqueue;
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueue *queue = pqueue;
+ EMapiOperationQueuePrivate *priv;
struct OPData *op = data;
gpointer worker_data = NULL;
gboolean cancelled = TRUE;
- g_return_if_fail (EM_IS_OPERATION_QUEUE (queue));
+ g_return_if_fail (E_MAPI_IS_OPERATION_QUEUE (queue));
g_return_if_fail (op != NULL);
priv = queue->priv;
@@ -147,15 +147,15 @@ thread_func_cb (gpointer data, gpointer pqueue)
g_free (op);
}
-EMOperationQueue *
-em_operation_queue_new (EMOperationQueueFunc worker_cb, gpointer user_data)
+EMapiOperationQueue *
+e_mapi_operation_queue_new (EMapiOperationQueueFunc worker_cb, gpointer user_data)
{
- EMOperationQueue *queue;
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueue *queue;
+ EMapiOperationQueuePrivate *priv;
g_return_val_if_fail (worker_cb != NULL, NULL);
- queue = g_object_new (EM_TYPE_OPERATION_QUEUE, NULL);
+ queue = g_object_new (E_MAPI_TYPE_OPERATION_QUEUE, NULL);
priv = queue->priv;
g_return_val_if_fail (priv != NULL, NULL);
@@ -167,13 +167,13 @@ em_operation_queue_new (EMOperationQueueFunc worker_cb, gpointer user_data)
}
void
-em_operation_queue_push (EMOperationQueue *queue, gpointer worker_data)
+e_mapi_operation_queue_push (EMapiOperationQueue *queue, gpointer worker_data)
{
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueuePrivate *priv;
struct OPData *op;
g_return_if_fail (queue != NULL);
- g_return_if_fail (EM_IS_OPERATION_QUEUE (queue));
+ g_return_if_fail (E_MAPI_IS_OPERATION_QUEUE (queue));
priv = queue->priv;
g_return_if_fail (priv != NULL);
@@ -191,14 +191,14 @@ em_operation_queue_push (EMOperationQueue *queue, gpointer worker_data)
}
gboolean
-em_operation_queue_cancel (EMOperationQueue *queue, gpointer worker_data)
+e_mapi_operation_queue_cancel (EMapiOperationQueue *queue, gpointer worker_data)
{
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueuePrivate *priv;
gboolean found = FALSE;
GSList *l;
g_return_val_if_fail (queue != NULL, FALSE);
- g_return_val_if_fail (EM_IS_OPERATION_QUEUE (queue), FALSE);
+ g_return_val_if_fail (E_MAPI_IS_OPERATION_QUEUE (queue), FALSE);
priv = queue->priv;
g_return_val_if_fail (priv != NULL, FALSE);
@@ -222,14 +222,14 @@ em_operation_queue_cancel (EMOperationQueue *queue, gpointer worker_data)
}
gboolean
-em_operation_queue_cancel_all (EMOperationQueue *queue)
+e_mapi_operation_queue_cancel_all (EMapiOperationQueue *queue)
{
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueuePrivate *priv;
gboolean found_any = FALSE;
GSList *l;
g_return_val_if_fail (queue != NULL, FALSE);
- g_return_val_if_fail (EM_IS_OPERATION_QUEUE (queue), FALSE);
+ g_return_val_if_fail (E_MAPI_IS_OPERATION_QUEUE (queue), FALSE);
priv = queue->priv;
g_return_val_if_fail (priv != NULL, FALSE);
@@ -254,13 +254,13 @@ em_operation_queue_cancel_all (EMOperationQueue *queue)
}
gint
-em_operation_queue_length (EMOperationQueue *queue)
+e_mapi_operation_queue_length (EMapiOperationQueue *queue)
{
- EMOperationQueuePrivate *priv;
+ EMapiOperationQueuePrivate *priv;
gint len;
g_return_val_if_fail (queue != NULL, -1);
- g_return_val_if_fail (EM_IS_OPERATION_QUEUE (queue), -1);
+ g_return_val_if_fail (E_MAPI_IS_OPERATION_QUEUE (queue), -1);
priv = queue->priv;
g_return_val_if_fail (priv != NULL, -1);
@@ -276,8 +276,8 @@ struct async_queue_data
{
gpointer worker_data;
gpointer user_data;
- EMOperationQueueFunc worker_cb;
- EMOperationQueueFunc done_cb;
+ EMapiOperationQueueFunc worker_cb;
+ EMapiOperationQueueFunc done_cb;
gboolean cancelled;
};
@@ -316,14 +316,14 @@ async_queue_worker_cb (gpointer worker_data, gboolean cancelled, gpointer user_d
g_free (data);
}
-EMOperationQueue *
-em_async_queue_new (void)
+EMapiOperationQueue *
+e_mapi_async_queue_new (void)
{
- return em_operation_queue_new (async_queue_worker_cb, NULL);
+ return e_mapi_operation_queue_new (async_queue_worker_cb, NULL);
}
void
-em_async_queue_push (EMOperationQueue *queue, gpointer worker_data, gpointer user_data, EMOperationQueueFunc worker_cb, EMOperationQueueFunc done_cb)
+e_mapi_async_queue_push (EMapiOperationQueue *queue, gpointer worker_data, gpointer user_data, EMapiOperationQueueFunc worker_cb, EMapiOperationQueueFunc done_cb)
{
struct async_queue_data *data;
@@ -335,5 +335,5 @@ em_async_queue_push (EMOperationQueue *queue, gpointer worker_data, gpointer use
data->worker_cb = worker_cb;
data->done_cb = done_cb;
- em_operation_queue_push (queue, data);
+ e_mapi_operation_queue_push (queue, data);
}
diff --git a/src/libexchangemapi/e-mapi-operation-queue.h b/src/libexchangemapi/e-mapi-operation-queue.h
new file mode 100644
index 0000000..fe58a5d
--- /dev/null
+++ b/src/libexchangemapi/e-mapi-operation-queue.h
@@ -0,0 +1,72 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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/>
+ *
+ *
+ * Copyright (C) 1999-2010 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#ifndef E_MAPI_OPERATION_QUEUE_H
+#define E_MAPI_OPERATION_QUEUE_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+/* Standard GObject macros */
+#define E_MAPI_TYPE_OPERATION_QUEUE (e_mapi_operation_queue_get_type ())
+#define E_MAPI_OPERATION_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_MAPI_TYPE_OPERATION_QUEUE, EMapiOperationQueue))
+#define E_MAPI_OPERATION_QUEUE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST ((cls), E_MAPI_TYPE_OPERATION_QUEUE, EMapiOperationQueueClass))
+#define E_MAPI_IS_OPERATION_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_MAPI_TYPE_OPERATION_QUEUE))
+#define E_MAPI_IS_OPERATION_QUEUE_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE ((cls), E_MAPI_TYPE_OPERATION_QUEUE))
+#define E_MAPI_OPERATION_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_MAPI_TYPE_OPERATION_QUEUE, EMapiOperationQueueClass))
+
+G_BEGIN_DECLS
+
+typedef struct _EMapiOperationQueue EMapiOperationQueue;
+typedef struct _EMapiOperationQueueClass EMapiOperationQueueClass;
+typedef struct _EMapiOperationQueuePrivate EMapiOperationQueuePrivate;
+
+struct _EMapiOperationQueue {
+ GObject parent;
+
+ EMapiOperationQueuePrivate *priv;
+};
+
+struct _EMapiOperationQueueClass {
+ GObjectClass parent_class;
+
+ /* signals */
+};
+
+GType e_mapi_operation_queue_get_type (void);
+
+/* 'user_data' corresponds to 'user_data' from e_mapi_operation_queue_new(),
+ 'worker_data' corresponds to 'worker_data' from e_mapi_operation_queue_push() */
+typedef void (*EMapiOperationQueueFunc)(gpointer worker_data, gboolean cancelled, gpointer user_data);
+
+EMapiOperationQueue * e_mapi_operation_queue_new (EMapiOperationQueueFunc worker_cb, gpointer user_data);
+void e_mapi_operation_queue_push (EMapiOperationQueue *queue, gpointer worker_data);
+gboolean e_mapi_operation_queue_cancel (EMapiOperationQueue *queue, gpointer worker_data);
+gboolean e_mapi_operation_queue_cancel_all (EMapiOperationQueue *queue);
+gint e_mapi_operation_queue_length (EMapiOperationQueue *queue);
+
+EMapiOperationQueue * e_mapi_async_queue_new (void);
+void e_mapi_async_queue_push (EMapiOperationQueue *queue,
+ gpointer worker_data,
+ gpointer user_data,
+ EMapiOperationQueueFunc worker_cb, /* run in a new thread */
+ EMapiOperationQueueFunc done_cb); /* run in a main thread */
+
+#endif /* E_MAPI_OPERATION_QUEUE */
diff --git a/src/libexchangemapi/exchange-mapi-utils.c b/src/libexchangemapi/e-mapi-utils.c
similarity index 78%
rename from src/libexchangemapi/exchange-mapi-utils.c
rename to src/libexchangemapi/e-mapi-utils.c
index fcf63b1..69a1424 100644
--- a/src/libexchangemapi/exchange-mapi-utils.c
+++ b/src/libexchangemapi/e-mapi-utils.c
@@ -28,8 +28,8 @@
#include <glib.h>
#include <gio/gio.h>
-#include "exchange-mapi-utils.h"
-#include "exchange-mapi-mail-utils.h"
+#include "e-mapi-utils.h"
+#include "e-mapi-mail-utils.h"
#ifdef G_OS_WIN32
/* Undef the similar macro from pthread.h, it doesn't check if
@@ -46,13 +46,13 @@
#define KRB_DBUS_INTERFACE "org.gnome.KrbAuthDialog"
inline gchar *
-exchange_mapi_util_mapi_id_to_string (mapi_id_t id)
+e_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 gchar *str, mapi_id_t *id)
+e_mapi_util_mapi_id_from_string (const gchar *str, mapi_id_t *id)
{
gint n = 0;
@@ -66,13 +66,13 @@ exchange_mapi_util_mapi_id_from_string (const gchar *str, mapi_id_t *id)
* Specifically, it is in this format: ("%016" G_GINT64_MODIFIER "X%016" G_GINT64_MODIFIER "X", fid, mid).
*/
inline gchar *
-exchange_mapi_util_mapi_ids_to_uid (mapi_id_t fid, mapi_id_t mid)
+e_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 gchar *str, mapi_id_t *fid, mapi_id_t *mid)
+e_mapi_util_mapi_ids_from_uid (const gchar *str, mapi_id_t *fid, mapi_id_t *mid)
{
gint n = 0;
@@ -96,7 +96,7 @@ exchange_mapi_util_mapi_ids_from_uid (const gchar *str, mapi_id_t *fid, mapi_id_
* return an 'int' or a 'systime', they should prefer get_SPropValue.
*/
gconstpointer
-exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint32_t proptag)
+e_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint32_t proptag)
{
if (((proptag & 0xFFFF) == PT_STRING8) ||
((proptag & 0xFFFF) == PT_UNICODE)) {
@@ -123,7 +123,7 @@ exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint3
}
gconstpointer
-exchange_mapi_util_find_SPropVal_array_namedid (struct SPropValue *values, ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
+e_mapi_util_find_SPropVal_array_namedid (struct SPropValue *values, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
{
uint32_t proptag;
gconstpointer res = NULL;
@@ -131,12 +131,12 @@ exchange_mapi_util_find_SPropVal_array_namedid (struct SPropValue *values, Excha
g_return_val_if_fail (values != NULL, NULL);
g_return_val_if_fail (conn != NULL, NULL);
- proptag = exchange_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
+ proptag = e_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
if (proptag != MAPI_E_RESERVED)
- res = exchange_mapi_util_find_SPropVal_array_propval (values, proptag);
+ res = e_mapi_util_find_SPropVal_array_propval (values, proptag);
if (!res)
- res = exchange_mapi_util_find_SPropVal_array_propval (values, namedid);
+ res = e_mapi_util_find_SPropVal_array_propval (values, namedid);
return res;
}
@@ -155,7 +155,7 @@ exchange_mapi_util_find_SPropVal_array_namedid (struct SPropValue *values, Excha
* return an 'int' or a 'systime', they should prefer find_SPropValue_data.
*/
gconstpointer
-exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag)
+e_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag)
{
if (((proptag & 0xFFFF) == PT_STRING8) ||
((proptag & 0xFFFF) == PT_UNICODE)) {
@@ -182,7 +182,7 @@ exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag)
}
gconstpointer
-exchange_mapi_util_find_row_namedid (struct SRow *aRow, ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
+e_mapi_util_find_row_namedid (struct SRow *aRow, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
{
uint32_t proptag;
gconstpointer res = NULL;
@@ -190,12 +190,12 @@ exchange_mapi_util_find_row_namedid (struct SRow *aRow, ExchangeMapiConnection *
g_return_val_if_fail (aRow != NULL, NULL);
g_return_val_if_fail (conn != NULL, NULL);
- proptag = exchange_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
+ proptag = e_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
if (proptag != MAPI_E_RESERVED)
- res = exchange_mapi_util_find_row_propval (aRow, proptag);
+ res = e_mapi_util_find_row_propval (aRow, proptag);
if (!res)
- res = exchange_mapi_util_find_row_propval (aRow, namedid);
+ res = e_mapi_util_find_row_propval (aRow, namedid);
return res;
}
@@ -214,7 +214,7 @@ exchange_mapi_util_find_row_namedid (struct SRow *aRow, ExchangeMapiConnection *
* return an 'int' or a 'systime', they should prefer find_mapi_SPropValue_data.
*/
gconstpointer
-exchange_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties, uint32_t proptag)
+e_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties, uint32_t proptag)
{
if (((proptag & 0xFFFF) == PT_STRING8) ||
((proptag & 0xFFFF) == PT_UNICODE)) {
@@ -241,7 +241,7 @@ exchange_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties,
}
gconstpointer
-exchange_mapi_util_find_array_namedid (struct mapi_SPropValue_array *properties, ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
+e_mapi_util_find_array_namedid (struct mapi_SPropValue_array *properties, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
{
uint32_t proptag;
gconstpointer res = NULL;
@@ -249,18 +249,18 @@ exchange_mapi_util_find_array_namedid (struct mapi_SPropValue_array *properties,
g_return_val_if_fail (properties != NULL, NULL);
g_return_val_if_fail (conn != NULL, NULL);
- proptag = exchange_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
+ proptag = e_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
if (proptag != MAPI_E_RESERVED)
- res = exchange_mapi_util_find_array_propval (properties, proptag);
+ res = e_mapi_util_find_array_propval (properties, proptag);
if (!res)
- res = exchange_mapi_util_find_array_propval (properties, namedid);
+ res = e_mapi_util_find_array_propval (properties, namedid);
return res;
}
enum MAPISTATUS
-exchange_mapi_util_find_array_datetime_propval (struct timeval *tv, struct mapi_SPropValue_array *properties, uint32_t proptag)
+e_mapi_util_find_array_datetime_propval (struct timeval *tv, struct mapi_SPropValue_array *properties, uint32_t proptag)
{
g_return_val_if_fail (tv != NULL, MAPI_E_INVALID_PARAMETER);
g_return_val_if_fail (properties != NULL, MAPI_E_INVALID_PARAMETER);
@@ -269,7 +269,7 @@ exchange_mapi_util_find_array_datetime_propval (struct timeval *tv, struct mapi_
}
enum MAPISTATUS
-exchange_mapi_util_find_array_datetime_namedid (struct timeval *tv, struct mapi_SPropValue_array *properties, ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
+e_mapi_util_find_array_datetime_namedid (struct timeval *tv, struct mapi_SPropValue_array *properties, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
{
enum MAPISTATUS res = MAPI_E_NOT_FOUND;
uint32_t proptag;
@@ -278,18 +278,18 @@ exchange_mapi_util_find_array_datetime_namedid (struct timeval *tv, struct mapi_
g_return_val_if_fail (properties != NULL, MAPI_E_INVALID_PARAMETER);
g_return_val_if_fail (conn != NULL, MAPI_E_INVALID_PARAMETER);
- proptag = exchange_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
+ proptag = e_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
if (proptag != MAPI_E_RESERVED)
- res = exchange_mapi_util_find_array_datetime_propval (tv, properties, proptag);
+ res = e_mapi_util_find_array_datetime_propval (tv, properties, proptag);
if (res == MAPI_E_NOT_FOUND)
- res = exchange_mapi_util_find_array_datetime_propval (tv, properties, namedid);
+ res = e_mapi_util_find_array_datetime_propval (tv, properties, namedid);
return res;
}
ExchangeMAPIStream *
-exchange_mapi_util_find_stream (GSList *stream_list, uint32_t proptag)
+e_mapi_util_find_stream (GSList *stream_list, uint32_t proptag)
{
GSList *l = stream_list;
@@ -303,7 +303,7 @@ exchange_mapi_util_find_stream (GSList *stream_list, uint32_t proptag)
}
ExchangeMAPIStream *
-exchange_mapi_util_find_stream_namedid (GSList *stream_list, ExchangeMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
+e_mapi_util_find_stream_namedid (GSList *stream_list, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid)
{
uint32_t proptag;
gconstpointer res = NULL;
@@ -313,18 +313,18 @@ exchange_mapi_util_find_stream_namedid (GSList *stream_list, ExchangeMapiConnect
if (!stream_list)
return NULL;
- proptag = exchange_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
+ proptag = e_mapi_connection_resolve_named_prop (conn, fid, namedid, NULL);
if (proptag != MAPI_E_RESERVED)
- res = exchange_mapi_util_find_stream (stream_list, proptag);
+ res = e_mapi_util_find_stream (stream_list, proptag);
if (!res)
- res = exchange_mapi_util_find_stream (stream_list, namedid);
+ res = e_mapi_util_find_stream (stream_list, namedid);
return (ExchangeMAPIStream *) res;
}
void
-exchange_mapi_util_free_attachment_list (GSList **attach_list)
+e_mapi_util_free_attachment_list (GSList **attach_list)
{
GSList *l = *attach_list;
@@ -338,7 +338,7 @@ exchange_mapi_util_free_attachment_list (GSList **attach_list)
mail_item_free (attachment->mail);
} else {
g_free (attachment->lpProps);
- exchange_mapi_util_free_stream_list (&(attachment->streams));
+ e_mapi_util_free_stream_list (&(attachment->streams));
}
g_free (attachment);
@@ -349,7 +349,7 @@ exchange_mapi_util_free_attachment_list (GSList **attach_list)
}
void
-exchange_mapi_util_free_recipient_list (GSList **recip_list)
+e_mapi_util_free_recipient_list (GSList **recip_list)
{
GSList *l = *recip_list;
@@ -373,7 +373,7 @@ exchange_mapi_util_free_recipient_list (GSList **recip_list)
}
void
-exchange_mapi_util_free_stream_list (GSList **stream_list)
+e_mapi_util_free_stream_list (GSList **stream_list)
{
GSList *l = *stream_list;
@@ -392,7 +392,7 @@ exchange_mapi_util_free_stream_list (GSList **stream_list)
}
static void
-exchange_mapi_util_bin_append_uint16 (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint16_t val)
+e_mapi_util_bin_append_uint16 (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint16_t val)
{
uint8_t *ptr = NULL;
@@ -406,7 +406,7 @@ exchange_mapi_util_bin_append_uint16 (TALLOC_CTX *mem_ctx, struct Binary_r *bin,
}
static void
-exchange_mapi_util_bin_append_uint32 (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint32_t val)
+e_mapi_util_bin_append_uint32 (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint32_t val)
{
uint8_t *ptr = NULL;
@@ -482,7 +482,7 @@ bin_decode_string (const uint8_t *ptr, uint32_t sz, gchar **str, gboolean is_uni
}
static void
-exchange_mapi_util_bin_append_string (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const gchar *val)
+e_mapi_util_bin_append_string (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const gchar *val)
{
gsize len = strlen (val);
gchar *ptr = NULL;
@@ -496,7 +496,7 @@ exchange_mapi_util_bin_append_string (TALLOC_CTX *mem_ctx, struct Binary_r *bin,
}
static void
-exchange_mapi_util_bin_append_val (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint8_t *val, gsize len)
+e_mapi_util_bin_append_val (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint8_t *val, gsize len)
{
uint8_t *ptr = NULL;
@@ -509,7 +509,7 @@ exchange_mapi_util_bin_append_val (TALLOC_CTX *mem_ctx, struct Binary_r *bin, co
}
static void
-exchange_mapi_util_bin_append_unicode (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const gchar *val)
+e_mapi_util_bin_append_unicode (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const gchar *val)
{
gunichar2 *utf16;
glong written = 0;
@@ -517,7 +517,7 @@ exchange_mapi_util_bin_append_unicode (TALLOC_CTX *mem_ctx, struct Binary_r *bin
utf16 = g_utf8_to_utf16 (val, -1, NULL, &written, NULL);
g_return_if_fail (utf16 != NULL);
- exchange_mapi_util_bin_append_val (mem_ctx, bin, (uint8_t *)utf16, (written + 1) * 2);
+ e_mapi_util_bin_append_val (mem_ctx, bin, (uint8_t *)utf16, (written + 1) * 2);
g_free (utf16);
}
@@ -532,7 +532,7 @@ static const uint8_t MAPI_ONE_OFF_UID[] = {
#define MAPI_ONE_OFF_MYSTERY_FLAG 0x1000
/**
- * exchange_mapi_util_recip_entryid_generate_smtp:
+ * e_mapi_util_recip_entryid_generate_smtp:
* @entryid: entry ID to be filled
* @display_name: the display name of the user
* @email: the email address
@@ -544,17 +544,17 @@ static const uint8_t MAPI_ONE_OFF_UID[] = {
* Return value: the recipient ENTRYID
**/
void
-exchange_mapi_util_recip_entryid_generate_smtp (TALLOC_CTX *mem_ctx, struct Binary_r *entryid, const gchar *display_name, const gchar *email)
+e_mapi_util_recip_entryid_generate_smtp (TALLOC_CTX *mem_ctx, struct Binary_r *entryid, const gchar *display_name, const gchar *email)
{
g_return_if_fail (entryid != NULL);
- exchange_mapi_util_bin_append_uint32 (mem_ctx, entryid, 0);
- exchange_mapi_util_bin_append_val (mem_ctx, entryid, MAPI_ONE_OFF_UID, sizeof(MAPI_ONE_OFF_UID));
- exchange_mapi_util_bin_append_uint16 (mem_ctx, entryid, 0);
- exchange_mapi_util_bin_append_uint16 (mem_ctx, entryid, MAPI_ONE_OFF_NO_RICH_INFO | MAPI_ONE_OFF_MYSTERY_FLAG | MAPI_ONE_OFF_UNICODE);
- exchange_mapi_util_bin_append_unicode (mem_ctx, entryid, display_name);
- exchange_mapi_util_bin_append_unicode (mem_ctx, entryid, "SMTP");
- exchange_mapi_util_bin_append_unicode (mem_ctx, entryid, email);
+ e_mapi_util_bin_append_uint32 (mem_ctx, entryid, 0);
+ e_mapi_util_bin_append_val (mem_ctx, entryid, MAPI_ONE_OFF_UID, sizeof(MAPI_ONE_OFF_UID));
+ e_mapi_util_bin_append_uint16 (mem_ctx, entryid, 0);
+ e_mapi_util_bin_append_uint16 (mem_ctx, entryid, MAPI_ONE_OFF_NO_RICH_INFO | MAPI_ONE_OFF_MYSTERY_FLAG | MAPI_ONE_OFF_UNICODE);
+ e_mapi_util_bin_append_unicode (mem_ctx, entryid, display_name);
+ e_mapi_util_bin_append_unicode (mem_ctx, entryid, "SMTP");
+ e_mapi_util_bin_append_unicode (mem_ctx, entryid, email);
}
static const uint8_t MAPI_LOCAL_UID[] = {
@@ -563,7 +563,7 @@ static const uint8_t MAPI_LOCAL_UID[] = {
};
/**
- * exchange_mapi_util_recip_entryid_generate_ex:
+ * e_mapi_util_recip_entryid_generate_ex:
* @exchange_dn: the Exchange 5.5-style DN of the local user
*
* Constructs an ENTRYID value that can be used as a MAPI
@@ -571,13 +571,13 @@ static const uint8_t MAPI_LOCAL_UID[] = {
* corresponding to the local user identified by @exchange_dn.
**/
void
-exchange_mapi_util_recip_entryid_generate_ex (TALLOC_CTX *mem_ctx, struct Binary_r *entryid, const gchar *exchange_dn)
+e_mapi_util_recip_entryid_generate_ex (TALLOC_CTX *mem_ctx, struct Binary_r *entryid, const gchar *exchange_dn)
{
- exchange_mapi_util_bin_append_uint32 (mem_ctx, entryid, 0);
- exchange_mapi_util_bin_append_val (mem_ctx, entryid, MAPI_LOCAL_UID, sizeof(MAPI_LOCAL_UID));
- exchange_mapi_util_bin_append_uint16 (mem_ctx, entryid, 1);
- exchange_mapi_util_bin_append_uint16 (mem_ctx, entryid, 0);
- exchange_mapi_util_bin_append_string (mem_ctx, entryid, exchange_dn);
+ e_mapi_util_bin_append_uint32 (mem_ctx, entryid, 0);
+ e_mapi_util_bin_append_val (mem_ctx, entryid, MAPI_LOCAL_UID, sizeof(MAPI_LOCAL_UID));
+ e_mapi_util_bin_append_uint16 (mem_ctx, entryid, 1);
+ e_mapi_util_bin_append_uint16 (mem_ctx, entryid, 0);
+ e_mapi_util_bin_append_string (mem_ctx, entryid, exchange_dn);
}
static gboolean
@@ -720,7 +720,7 @@ recip_entryid_decode_ex (const struct Binary_r *entryid, gchar **exchange_dn)
}
/**
- * exchange_mapi_util_recip_entryid_decode:
+ * e_mapi_util_recip_entryid_decode:
* @conn: ExchangeMapiCOnnection to resolve names, if required
* @entryid: recipient's ENTRYID to decode
* @display_name: (out): stored display name, if any; can be NULL
@@ -729,7 +729,7 @@ recip_entryid_decode_ex (const struct Binary_r *entryid, gchar **exchange_dn)
* Returns: Whether was able to decode recipient information from the @entryid.
**/
gboolean
-exchange_mapi_util_recip_entryid_decode (ExchangeMapiConnection *conn, const struct Binary_r *entryid, gchar **display_name, gchar **email)
+e_mapi_util_recip_entryid_decode (EMapiConnection *conn, const struct Binary_r *entryid, gchar **display_name, gchar **email)
{
gchar *dispnm = NULL, *exchange_dn = NULL;
@@ -751,7 +751,7 @@ exchange_mapi_util_recip_entryid_decode (ExchangeMapiConnection *conn, const str
}
if (recip_entryid_decode_ex (entryid, &exchange_dn)) {
- *email = exchange_mapi_connection_ex_to_smtp (conn, exchange_dn, display_name, NULL);
+ *email = e_mapi_connection_ex_to_smtp (conn, exchange_dn, display_name, NULL);
g_free (exchange_dn);
return *email != NULL;
@@ -824,11 +824,11 @@ exchange_crlf_to_lf (const gchar *in)
}
/**
- * exchange_mapi_util_profiledata_from_settings:
+ * e_mapi_util_profiledata_from_settings:
* @empd: destination for profile settings
* @settings: a #CamelMapiSettings
*
- * Sets the members of an ExchangeMapiProfileData instance to
+ * Sets the members of an EMapiProfileData instance to
* reflect the account settings in @settings.
*
* @note: no allocation is done, so do not finalize @settings and the
@@ -836,7 +836,7 @@ exchange_crlf_to_lf (const gchar *in)
* profile data.
**/
void
-exchange_mapi_util_profiledata_from_settings (ExchangeMapiProfileData *empd, CamelMapiSettings *settings)
+e_mapi_util_profiledata_from_settings (EMapiProfileData *empd, CamelMapiSettings *settings)
{
CamelNetworkSettings *network_settings;
CamelNetworkSecurityMethod security_method;
@@ -851,7 +851,7 @@ exchange_mapi_util_profiledata_from_settings (ExchangeMapiProfileData *empd, Cam
}
gboolean
-exchange_mapi_util_trigger_krb_auth (const ExchangeMapiProfileData *empd, GError **error) {
+e_mapi_util_trigger_krb_auth (const EMapiProfileData *empd, GError **error) {
gint success = FALSE;
GError *local_error = NULL;
GDBusConnection *connection;
@@ -914,7 +914,7 @@ exchange_mapi_util_trigger_krb_auth (const ExchangeMapiProfileData *empd, GError
/**
- * exchange_mapi_util_profile_name:
+ * e_mapi_util_profile_name:
* @empd: profile information used to construct the name
* @migrate: whether migrate old profile name to a new one
*
@@ -923,7 +923,7 @@ exchange_mapi_util_trigger_krb_auth (const ExchangeMapiProfileData *empd, GError
* rename old profile name string to a new name, if requested.
**/
gchar *
-exchange_mapi_util_profile_name (const ExchangeMapiProfileData *empd, gboolean migrate)
+e_mapi_util_profile_name (const EMapiProfileData *empd, gboolean migrate)
{
gchar *res;
@@ -939,7 +939,7 @@ exchange_mapi_util_profile_name (const ExchangeMapiProfileData *empd, gboolean m
empd->domain);
old_name = g_strcanon (old_name, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@", '_');
- exchange_mapi_rename_profile (old_name, res);
+ e_mapi_rename_profile (old_name, res);
g_free (old_name);
}
@@ -951,7 +951,7 @@ exchange_mapi_util_profile_name (const ExchangeMapiProfileData *empd, gboolean m
* Adds prop_ids to props array. props should be created within the given mem_ctx.
**/
gboolean
-exchange_mapi_utils_add_props_to_props_array (TALLOC_CTX *mem_ctx, struct SPropTagArray *props, const uint32_t *prop_ids, guint prop_ids_n_elems)
+e_mapi_utils_add_props_to_props_array (TALLOC_CTX *mem_ctx, struct SPropTagArray *props, const uint32_t *prop_ids, guint prop_ids_n_elems)
{
guint i;
@@ -969,7 +969,7 @@ exchange_mapi_utils_add_props_to_props_array (TALLOC_CTX *mem_ctx, struct SPropT
/* Beware, the named_ids_list array is modified */
gboolean
-exchange_mapi_utils_add_named_ids_to_props_array (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, ResolveNamedIDsData *named_ids_list, guint named_ids_n_elems)
+e_mapi_utils_add_named_ids_to_props_array (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, ResolveNamedIDsData *named_ids_list, guint named_ids_n_elems)
{
guint i;
@@ -980,7 +980,7 @@ exchange_mapi_utils_add_named_ids_to_props_array (ExchangeMapiConnection *conn,
g_return_val_if_fail (named_ids_list != NULL, FALSE);
g_return_val_if_fail (named_ids_n_elems > 0, FALSE);
- if (!exchange_mapi_connection_resolve_named_props (conn, fid, named_ids_list, named_ids_n_elems, NULL))
+ if (!e_mapi_connection_resolve_named_props (conn, fid, named_ids_list, named_ids_n_elems, NULL))
return FALSE;
for (i = 0; i < named_ids_n_elems; i++) {
@@ -996,7 +996,7 @@ exchange_mapi_utils_add_named_ids_to_props_array (ExchangeMapiConnection *conn,
* *n_values holds number of items stored in the array, and will be increased by one.
**/
gboolean
-exchange_mapi_utils_add_spropvalue (TALLOC_CTX *mem_ctx, struct SPropValue **values_array, uint32_t *n_values, uint32_t prop_tag, gconstpointer prop_value)
+e_mapi_utils_add_spropvalue (TALLOC_CTX *mem_ctx, struct SPropValue **values_array, uint32_t *n_values, uint32_t prop_tag, gconstpointer prop_value)
{
g_return_val_if_fail (mem_ctx != NULL, FALSE);
g_return_val_if_fail (values_array != NULL, FALSE);
@@ -1007,9 +1007,9 @@ exchange_mapi_utils_add_spropvalue (TALLOC_CTX *mem_ctx, struct SPropValue **val
return TRUE;
}
-/* similar as exchange_mapi_utils_add_spropvalue, just here is not used prop_tag, but named id */
+/* similar as e_mapi_utils_add_spropvalue, just here is not used prop_tag, but named id */
gboolean
-exchange_mapi_utils_add_spropvalue_namedid (ExchangeMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values_array, uint32_t *n_values, uint32_t named_id, gconstpointer prop_value)
+e_mapi_utils_add_spropvalue_namedid (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values_array, uint32_t *n_values, uint32_t named_id, gconstpointer prop_value)
{
uint32_t prop_tag;
@@ -1019,16 +1019,16 @@ exchange_mapi_utils_add_spropvalue_namedid (ExchangeMapiConnection *conn, mapi_i
g_return_val_if_fail (values_array != NULL, FALSE);
g_return_val_if_fail (n_values != NULL, FALSE);
- prop_tag = exchange_mapi_connection_resolve_named_prop (conn, fid, named_id, NULL);
+ prop_tag = e_mapi_connection_resolve_named_prop (conn, fid, named_id, NULL);
if (prop_tag == MAPI_E_RESERVED)
return FALSE;
- return exchange_mapi_utils_add_spropvalue (mem_ctx, values_array, n_values, prop_tag, prop_value);
+ return e_mapi_utils_add_spropvalue (mem_ctx, values_array, n_values, prop_tag, prop_value);
}
/* the first call should be with crc32 set to 0 */
uint32_t
-exchange_mapi_utils_push_crc32 (uint32_t crc32, uint8_t *bytes, uint32_t n_bytes)
+e_mapi_utils_push_crc32 (uint32_t crc32, uint8_t *bytes, uint32_t n_bytes)
{
static uint32_t crc_32_tab[] = { /* CRC polynomial 0xedb88320 */
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
@@ -1090,9 +1090,9 @@ exchange_mapi_utils_push_crc32 (uint32_t crc32, uint8_t *bytes, uint32_t n_bytes
return crc32;
}
-/* copies a Binary_r, which should be freed with exchange_mapi_util_free_binary_r() */
+/* copies a Binary_r, which should be freed with e_mapi_util_free_binary_r() */
struct Binary_r *
-exchange_mapi_util_copy_binary_r (const struct Binary_r *bin)
+e_mapi_util_copy_binary_r (const struct Binary_r *bin)
{
struct Binary_r *res;
@@ -1107,9 +1107,9 @@ exchange_mapi_util_copy_binary_r (const struct Binary_r *bin)
return res;
}
-/* frees Binary_r previously allocated by exchange_mapi_util_copy_binary_r() */
+/* frees Binary_r previously allocated by e_mapi_util_copy_binary_r() */
void
-exchange_mapi_util_free_binary_r (struct Binary_r *bin)
+e_mapi_util_free_binary_r (struct Binary_r *bin)
{
if (!bin)
return;
@@ -1119,7 +1119,7 @@ exchange_mapi_util_free_binary_r (struct Binary_r *bin)
}
time_t
-exchange_mapi_util_filetime_to_time_t (const struct FILETIME *filetime)
+e_mapi_util_filetime_to_time_t (const struct FILETIME *filetime)
{
NTTIME nt;
@@ -1137,7 +1137,7 @@ exchange_mapi_util_filetime_to_time_t (const struct FILETIME *filetime)
}
void
-exchange_mapi_util_time_t_to_filetime (const time_t tt, struct FILETIME *filetime)
+e_mapi_util_time_t_to_filetime (const time_t tt, struct FILETIME *filetime)
{
NTTIME nt;
diff --git a/src/libexchangemapi/e-mapi-utils.h b/src/libexchangemapi/e-mapi-utils.h
new file mode 100644
index 0000000..8a914b2
--- /dev/null
+++ b/src/libexchangemapi/e-mapi-utils.h
@@ -0,0 +1,79 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * 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/>
+ *
+ *
+ * Authors:
+ * Suman Manjunath <msuman novell com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#ifndef E_MAPI_UTILS_H
+#define E_MAPI_UTILS_H
+
+#include "camel-mapi-settings.h"
+#include "e-mapi-debug.h"
+#include "e-mapi-connection.h"
+
+gchar * e_mapi_util_mapi_id_to_string (mapi_id_t id);
+gboolean e_mapi_util_mapi_id_from_string (const gchar *str, mapi_id_t *id);
+
+gchar * e_mapi_util_mapi_ids_to_uid (mapi_id_t fid, mapi_id_t mid);
+gboolean e_mapi_util_mapi_ids_from_uid (const gchar *str, mapi_id_t *fid, mapi_id_t *mid);
+
+gconstpointer e_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint32_t proptag);
+gconstpointer e_mapi_util_find_SPropVal_array_namedid (struct SPropValue *values, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid);
+gconstpointer e_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag);
+gconstpointer e_mapi_util_find_row_namedid (struct SRow *aRow, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid);
+gconstpointer e_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties, uint32_t proptag);
+gconstpointer e_mapi_util_find_array_namedid (struct mapi_SPropValue_array *properties, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid);
+
+enum MAPISTATUS e_mapi_util_find_array_datetime_propval (struct timeval *tv, struct mapi_SPropValue_array *properties, uint32_t proptag);
+enum MAPISTATUS e_mapi_util_find_array_datetime_namedid (struct timeval *tv, struct mapi_SPropValue_array *properties, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid);
+
+ExchangeMAPIStream *e_mapi_util_find_stream (GSList *stream_list, uint32_t proptag);
+ExchangeMAPIStream *e_mapi_util_find_stream_namedid (GSList *stream_list, EMapiConnection *conn, mapi_id_t fid, uint32_t namedid);
+
+void e_mapi_util_free_attachment_list (GSList **attach_list);
+void e_mapi_util_free_recipient_list (GSList **recip_list);
+void e_mapi_util_free_stream_list (GSList **stream_list);
+
+void e_mapi_util_recip_entryid_generate_smtp (TALLOC_CTX *mem_ctx, struct Binary_r *entryid, const gchar *display_name, const gchar *email);
+void e_mapi_util_recip_entryid_generate_ex (TALLOC_CTX *mem_ctx, struct Binary_r *entryid, const gchar *exchange_dn);
+gboolean e_mapi_util_recip_entryid_decode (EMapiConnection *conn, const struct Binary_r *entyrid, gchar **display_name, gchar **email);
+
+gchar *exchange_lf_to_crlf (const gchar *in);
+gchar *exchange_crlf_to_lf (const gchar *in);
+
+void e_mapi_util_profiledata_from_settings (EMapiProfileData *empd, CamelMapiSettings *settings);
+gchar *e_mapi_util_profile_name (const EMapiProfileData *empd, gboolean migrate);
+gboolean e_mapi_util_trigger_krb_auth (const EMapiProfileData *empd, GError **error);
+
+gboolean e_mapi_utils_add_props_to_props_array (TALLOC_CTX *mem_ctx, struct SPropTagArray *props, const uint32_t *prop_ids, guint prop_ids_n_elems);
+gboolean e_mapi_utils_add_named_ids_to_props_array (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropTagArray *props, ResolveNamedIDsData *named_ids_list, guint named_ids_n_elems);
+
+gboolean e_mapi_utils_add_spropvalue (TALLOC_CTX *mem_ctx, struct SPropValue **values_array, uint32_t *n_values, uint32_t prop_tag, gconstpointer prop_value);
+gboolean e_mapi_utils_add_spropvalue_namedid (EMapiConnection *conn, mapi_id_t fid, TALLOC_CTX *mem_ctx, struct SPropValue **values_array, uint32_t *n_values, uint32_t named_id, gconstpointer prop_value);
+
+uint32_t e_mapi_utils_push_crc32 (uint32_t crc32, uint8_t *bytes, uint32_t n_bytes);
+
+struct Binary_r *e_mapi_util_copy_binary_r (const struct Binary_r *bin);
+void e_mapi_util_free_binary_r (struct Binary_r *bin);
+
+time_t e_mapi_util_filetime_to_time_t (const struct FILETIME *filetime);
+void e_mapi_util_time_t_to_filetime (const time_t tt, struct FILETIME *filetime);
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]