aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-27 22:29:19 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-27 22:29:19 +0800
commit948235c3d1076dbe6ed2e57a24c16a083bbd9f01 (patch)
tree4133b1adfd94d8f889ca7ad4ad851346518f4171 /mail/mail-ops.c
parentcc3a98fc1ad5bb87aa7335f3de404ee7feee1541 (diff)
downloadgsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.gz
gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.zst
gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.zip
Prefer GLib basic types over C types.
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c332
1 files changed, 166 insertions, 166 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index d1116395b6..a10766bf32 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -74,7 +74,7 @@
#define w(x)
#define d(x)
-extern const char *x_mailer;
+extern const gchar *x_mailer;
/* used for both just filtering a folder + uid's, and for filtering a whole folder */
/* used both for fetching mail, and for filtering mail */
@@ -86,7 +86,7 @@ struct _filter_mail_msg {
CamelUIDCache *cache; /* UID cache if we are to cache the uids, NULL otherwise */
CamelOperation *cancel;
CamelFilterDriver *driver;
- int delete; /* delete messages after filtering them? */
+ gint delete; /* delete messages after filtering them? */
CamelFolder *destination; /* default destination for any messages, NULL for none */
};
@@ -95,12 +95,12 @@ struct _fetch_mail_msg {
struct _filter_mail_msg fmsg;
CamelOperation *cancel; /* we have our own cancellation struct, the other should be empty */
- int keep; /* keep on server? */
+ gint keep; /* keep on server? */
- char *source_uri;
+ gchar *source_uri;
- void (*done)(const char *source, void *data);
- void *data;
+ void (*done)(const gchar *source, gpointer data);
+ gpointer data;
};
static gchar *
@@ -199,7 +199,7 @@ static MailMsgInfo em_filter_folder_element_info = {
void
mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids,
- const char *type, gboolean notify,
+ const gchar *type, gboolean notify,
CamelOperation *cancel)
{
struct _filter_mail_msg *m;
@@ -242,12 +242,12 @@ mail_filter_junk (CamelFolder *folder, GPtrArray *uids)
/* ********************************************************************** */
/* Temporary workaround for various issues. Gone before 0.11 */
-static char *
+static gchar *
uid_cachename_hack (CamelStore *store)
{
CamelURL *url = CAMEL_SERVICE (store)->url;
EShellBackend *shell_backend;
- char *encoded_url, *filename;
+ gchar *encoded_url, *filename;
const gchar *data_dir;
shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
@@ -275,7 +275,7 @@ static void
fetch_mail_exec (struct _fetch_mail_msg *m)
{
struct _filter_mail_msg *fm = (struct _filter_mail_msg *)m;
- int i;
+ gint i;
if (m->cancel)
camel_operation_register (m->cancel);
@@ -289,7 +289,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
/* FIXME: this should support keep_on_server too, which would then perform a spool
access thingy, right? problem is matching raw messages to uid's etc. */
if (!strncmp (m->source_uri, "mbox:", 5)) {
- char *path = mail_tool_do_movemail (m->source_uri, &fm->base.ex);
+ gchar *path = mail_tool_do_movemail (m->source_uri, &fm->base.ex);
if (path && !camel_exception_is_set (&fm->base.ex)) {
camel_folder_freeze (fm->destination);
@@ -308,7 +308,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
/* this handles 'keep on server' stuff, if we have any new uid's to copy
across, we need to copy them to a new array 'cause of the way fetch_mail_free works */
CamelUIDCache *cache = NULL;
- char *cachename;
+ gchar *cachename;
cachename = uid_cachename_hack (folder->parent_store);
cache = camel_uid_cache_new (cachename);
@@ -341,7 +341,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
if (fm->delete && !camel_exception_is_set (&fm->base.ex)) {
/* not keep on server - just delete all the actual messages on the server */
for (i=0;i<folder_uids->len;i++) {
- d(printf("force delete uid '%s'\n", (char *)folder_uids->pdata[i]));
+ d(printf("force delete uid '%s'\n", (gchar *)folder_uids->pdata[i]));
camel_folder_delete_message(folder, folder_uids->pdata[i]);
}
}
@@ -404,10 +404,10 @@ static MailMsgInfo fetch_mail_info = {
/* ouch, a 'do everything' interface ... */
void
-mail_fetch_mail (const char *source, int keep, const char *type, CamelOperation *cancel,
- CamelFilterGetFolderFunc get_folder, void *get_data,
- CamelFilterStatusFunc *status, void *status_data,
- void (*done)(const char *source, void *data), void *data)
+mail_fetch_mail (const gchar *source, gint keep, const gchar *type, CamelOperation *cancel,
+ CamelFilterGetFolderFunc get_folder, gpointer get_data,
+ CamelFilterStatusFunc *status, gpointer status_data,
+ void (*done)(const gchar *source, gpointer data), gpointer data)
{
struct _fetch_mail_msg *m;
struct _filter_mail_msg *fm;
@@ -450,21 +450,21 @@ static const gchar *resent_recipients[] = {
/* send 1 message to a specific transport */
static void
-mail_send_message(CamelFolder *queue, const char *uid, const char *destination, CamelFilterDriver *driver, CamelException *ex)
+mail_send_message(CamelFolder *queue, const gchar *uid, const gchar *destination, CamelFilterDriver *driver, CamelException *ex)
{
EAccount *account = NULL;
const CamelInternetAddress *iaddr;
CamelAddress *from, *recipients;
CamelMessageInfo *info = NULL;
CamelTransport *xport = NULL;
- char *transport_url = NULL;
- char *sent_folder_uri = NULL;
- const char *resent_from, *tmp;
+ gchar *transport_url = NULL;
+ gchar *sent_folder_uri = NULL;
+ const gchar *resent_from, *tmp;
CamelFolder *folder = NULL;
GString *err = NULL;
struct _camel_header_raw *xev, *header;
CamelMimeMessage *message;
- int i;
+ gint i;
message = camel_folder_get_message(queue, uid, ex);
if (!message)
@@ -477,7 +477,7 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
tmp = camel_header_raw_find(&xev, "X-Evolution-Account", NULL);
if (tmp) {
- char *name;
+ gchar *name;
name = g_strstrip(g_strdup(tmp));
if ((account = e_get_account_by_uid (name))
@@ -514,7 +514,7 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
recipients = (CamelAddress *) camel_internet_address_new ();
for (i = 0; i < 3; i++) {
- const char *type;
+ const gchar *type;
type = resent_from ? resent_recipients[i] : normal_recipients[i];
iaddr = camel_mime_message_get_recipients (message, type);
@@ -537,7 +537,7 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
camel_mime_message_set_date(message, CAMEL_MESSAGE_DATE_CURRENT, 0);
for (header = xev;header;header=header->next) {
- char *uri;
+ gchar *uri;
if (strcmp(header->name, "X-Evolution-PostTo") != 0)
continue;
@@ -604,9 +604,9 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
global_mail_shell_backend, E_MAIL_FOLDER_SENT);
if (folder != sent_folder) {
- const char *name;
+ const gchar *name;
- camel_object_get (folder, NULL, CAMEL_OBJECT_DESCRIPTION, (char **) &name, 0);
+ camel_object_get (folder, NULL, CAMEL_OBJECT_DESCRIPTION, (gchar **) &name, 0);
if (err->len)
g_string_append(err, "\n\n");
g_string_append_printf (err, _("Failed to append to %s: %s\n"
@@ -665,24 +665,24 @@ struct _send_queue_msg {
MailMsg base;
CamelFolder *queue;
- char *destination;
+ gchar *destination;
CamelFilterDriver *driver;
CamelOperation *cancel;
/* we use camelfilterstatusfunc, even though its not the filter doing it */
CamelFilterStatusFunc *status;
- void *status_data;
+ gpointer status_data;
- void (*done)(const char *destination, void *data);
- void *data;
+ void (*done)(const gchar *destination, gpointer data);
+ gpointer data;
};
static void
-report_status (struct _send_queue_msg *m, enum camel_filter_status_t status, int pc, const char *desc, ...)
+report_status (struct _send_queue_msg *m, enum camel_filter_status_t status, gint pc, const gchar *desc, ...)
{
va_list ap;
- char *str;
+ gchar *str;
if (m->status) {
va_start (ap, desc);
@@ -699,7 +699,7 @@ send_queue_exec (struct _send_queue_msg *m)
CamelFolder *sent_folder;
GPtrArray *uids, *send_uids = NULL;
CamelException ex;
- int i, j;
+ gint i, j;
d(printf("sending queue\n"));
@@ -743,7 +743,7 @@ send_queue_exec (struct _send_queue_msg *m)
used as a mechanism to accumualte warning messages and present them back to the user. */
for (i = 0, j = 0; i < send_uids->len; i++) {
- int pc = (100 * i) / send_uids->len;
+ gint pc = (100 * i) / send_uids->len;
report_status (m, CAMEL_FILTER_STATUS_START, pc, _("Sending message %d of %d"), i+1, send_uids->len);
if (!m->cancel)
@@ -840,11 +840,11 @@ static MailMsgInfo send_queue_info = {
/* same interface as fetch_mail, just 'cause i'm lazy today (and we need to run it from the same spot?) */
void
-mail_send_queue(CamelFolder *queue, const char *destination,
- const char *type, CamelOperation *cancel,
- CamelFilterGetFolderFunc get_folder, void *get_data,
- CamelFilterStatusFunc *status, void *status_data,
- void (*done)(const char *destination, void *data), void *data)
+mail_send_queue(CamelFolder *queue, const gchar *destination,
+ const gchar *type, CamelOperation *cancel,
+ CamelFilterGetFolderFunc get_folder, gpointer get_data,
+ CamelFilterStatusFunc *status, gpointer status_data,
+ void (*done)(const gchar *destination, gpointer data), gpointer data)
{
struct _send_queue_msg *m;
@@ -879,10 +879,10 @@ struct _append_msg {
CamelFolder *folder;
CamelMimeMessage *message;
CamelMessageInfo *info;
- char *appended_uid;
+ gchar *appended_uid;
- void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, const char *appended_uid, void *data);
- void *data;
+ void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, gint ok, const gchar *appended_uid, gpointer data);
+ gpointer data;
};
static gchar *
@@ -923,8 +923,8 @@ static MailMsgInfo append_mail_info = {
void
mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageInfo *info,
- void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, const char *appended_uid, void *data),
- void *data)
+ void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, gint ok, const gchar *appended_uid, gpointer data),
+ gpointer data)
{
struct _append_msg *m;
@@ -955,11 +955,11 @@ struct _transfer_msg {
CamelFolder *source;
GPtrArray *uids;
gboolean delete;
- char *dest_uri;
+ gchar *dest_uri;
guint32 dest_flags;
- void (*done)(gboolean ok, void *data);
- void *data;
+ void (*done)(gboolean ok, gpointer data);
+ gpointer data;
};
static gchar *
@@ -993,7 +993,7 @@ transfer_messages_exec (struct _transfer_msg *m)
/* make sure all deleted messages are marked as seen */
if (m->delete) {
- int i;
+ gint i;
for (i = 0; i < m->uids->len; i++)
camel_folder_set_message_flags (m->source, m->uids->pdata[i],
@@ -1032,10 +1032,10 @@ static MailMsgInfo transfer_messages_info = {
void
mail_transfer_messages (CamelFolder *source, GPtrArray *uids,
gboolean delete_from_source,
- const char *dest_uri,
+ const gchar *dest_uri,
guint32 dest_flags,
- void (*done) (gboolean ok, void *data),
- void *data)
+ void (*done) (gboolean ok, gpointer data),
+ gpointer data)
{
struct _transfer_msg *m;
@@ -1063,15 +1063,15 @@ struct _get_folderinfo_msg {
CamelStore *store;
CamelFolderInfo *info;
- gboolean (*done)(CamelStore *store, CamelFolderInfo *info, void *data);
- void *data;
+ gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data);
+ gpointer data;
gboolean can_clear; /* whether we can clear folder info */
};
static gchar *
get_folderinfo_desc (struct _get_folderinfo_msg *m)
{
- char *ret, *name;
+ gchar *ret, *name;
name = camel_service_get_name((CamelService *)m->store, TRUE);
ret = g_strdup_printf(_("Scanning folders in \"%s\""), name);
@@ -1091,7 +1091,7 @@ static void
get_folderinfo_done (struct _get_folderinfo_msg *m)
{
if (!m->info && camel_exception_is_set (&m->base.ex)) {
- char *url;
+ gchar *url;
url = camel_service_get_url (CAMEL_SERVICE (m->store));
w(g_warning ("Error getting folder info from store at %s: %s",
@@ -1121,11 +1121,11 @@ static MailMsgInfo get_folderinfo_info = {
(MailMsgFreeFunc) get_folderinfo_free
};
-int
-mail_get_folderinfo (CamelStore *store, CamelOperation *op, gboolean (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
+gint
+mail_get_folderinfo (CamelStore *store, CamelOperation *op, gboolean (*done)(CamelStore *store, CamelFolderInfo *info, gpointer data), gpointer data)
{
struct _get_folderinfo_msg *m;
- int id;
+ gint id;
m = mail_msg_new(&get_folderinfo_info);
if (op) {
@@ -1147,18 +1147,18 @@ mail_get_folderinfo (CamelStore *store, CamelOperation *op, gboolean (*done)(Cam
/* ** ATTACH MESSAGES ****************************************************** */
struct _build_data {
- void (*done)(CamelFolder *folder, GPtrArray *uids, CamelMimePart *part, char *subject, void *data);
- void *data;
+ void (*done)(CamelFolder *folder, GPtrArray *uids, CamelMimePart *part, gchar *subject, gpointer data);
+ gpointer data;
};
static void
-do_build_attachment (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *data)
+do_build_attachment (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, gpointer data)
{
struct _build_data *d = data;
CamelMultipart *multipart;
CamelMimePart *part;
- char *subject;
- int i;
+ gchar *subject;
+ gint i;
if (messages->len == 0) {
d->done(folder, messages, NULL, NULL, d->data);
@@ -1195,7 +1195,7 @@ do_build_attachment (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages,
void
mail_build_attachment(CamelFolder *folder, GPtrArray *uids,
- void (*done)(CamelFolder *folder, GPtrArray *messages, CamelMimePart *part, char *subject, void *data), void *data)
+ void (*done)(CamelFolder *folder, GPtrArray *messages, CamelMimePart *part, gchar *subject, gpointer data), gpointer data)
{
struct _build_data *d;
@@ -1213,11 +1213,11 @@ mail_build_attachment(CamelFolder *folder, GPtrArray *uids,
struct _get_folder_msg {
MailMsg base;
- char *uri;
+ gchar *uri;
guint32 flags;
CamelFolder *folder;
- void (*done) (char *uri, CamelFolder *folder, void *data);
- void *data;
+ void (*done) (gchar *uri, CamelFolder *folder, gpointer data);
+ gpointer data;
};
static gchar *
@@ -1255,13 +1255,13 @@ static MailMsgInfo get_folder_info = {
(MailMsgFreeFunc) get_folder_free
};
-int
-mail_get_folder (const char *uri, guint32 flags,
- void (*done)(char *uri, CamelFolder *folder, void *data),
- void *data, MailMsgDispatchFunc dispatch)
+gint
+mail_get_folder (const gchar *uri, guint32 flags,
+ void (*done)(gchar *uri, CamelFolder *folder, gpointer data),
+ gpointer data, MailMsgDispatchFunc dispatch)
{
struct _get_folder_msg *m;
- int id;
+ gint id;
m = mail_msg_new(&get_folder_info);
m->uri = g_strdup (uri);
@@ -1281,9 +1281,9 @@ struct _get_quota_msg {
CamelFolder *folder;
CamelFolderQuotaInfo *quota;
- void (*done) (CamelFolder *folder, const gchar *folder_uri, CamelFolderQuotaInfo *quota, void *data);
+ void (*done) (CamelFolder *folder, const gchar *folder_uri, CamelFolderQuotaInfo *quota, gpointer data);
gchar *folder_uri;
- void *data;
+ gpointer data;
};
static gchar *
@@ -1323,14 +1323,14 @@ static MailMsgInfo get_quota_info = {
(MailMsgFreeFunc) get_quota_free
};
-int
+gint
mail_get_folder_quota (CamelFolder *folder,
const gchar *folder_uri,
- void (*done)(CamelFolder *folder, const gchar *uri, CamelFolderQuotaInfo *quota, void *data),
- void *data, MailMsgDispatchFunc dispatch)
+ void (*done)(CamelFolder *folder, const gchar *uri, CamelFolderQuotaInfo *quota, gpointer data),
+ gpointer data, MailMsgDispatchFunc dispatch)
{
struct _get_quota_msg *m;
- int id;
+ gint id;
g_return_val_if_fail (folder != NULL, -1);
@@ -1352,10 +1352,10 @@ mail_get_folder_quota (CamelFolder *folder,
struct _get_store_msg {
MailMsg base;
- char *uri;
+ gchar *uri;
CamelStore *store;
- void (*done) (char *uri, CamelStore *store, void *data);
- void *data;
+ void (*done) (gchar *uri, CamelStore *store, gpointer data);
+ gpointer data;
};
static gchar *
@@ -1397,11 +1397,11 @@ static MailMsgInfo get_store_info = {
(MailMsgFreeFunc) get_store_free
};
-int
-mail_get_store (const char *uri, CamelOperation *op, void (*done) (char *uri, CamelStore *store, void *data), void *data)
+gint
+mail_get_store (const gchar *uri, CamelOperation *op, void (*done) (gchar *uri, CamelStore *store, gpointer data), gpointer data)
{
struct _get_store_msg *m;
- int id;
+ gint id;
m = mail_msg_new (&get_store_info);
if (op) {
@@ -1425,8 +1425,8 @@ struct _remove_folder_msg {
CamelFolder *folder;
gboolean removed;
- void (*done) (CamelFolder *folder, gboolean removed, CamelException *ex, void *data);
- void *data;
+ void (*done) (CamelFolder *folder, gboolean removed, CamelException *ex, gpointer data);
+ gpointer data;
};
static gchar *
@@ -1454,7 +1454,7 @@ remove_folder_rec (CamelStore *store, CamelFolderInfo *fi, CamelException *ex)
if (!CAMEL_IS_VEE_FOLDER (folder)) {
GPtrArray *uids = camel_folder_get_uids (folder);
- int i;
+ gint i;
/* Delete every message in this folder, then expunge it */
camel_folder_freeze (folder);
@@ -1522,7 +1522,7 @@ static MailMsgInfo remove_folder_info = {
};
void
-mail_remove_folder (CamelFolder *folder, void (*done) (CamelFolder *folder, gboolean removed, CamelException *ex, void *data), void *data)
+mail_remove_folder (CamelFolder *folder, void (*done) (CamelFolder *folder, gboolean removed, CamelException *ex, gpointer data), gpointer data)
{
struct _remove_folder_msg *m;
@@ -1543,8 +1543,8 @@ struct _sync_folder_msg {
MailMsg base;
CamelFolder *folder;
- void (*done) (CamelFolder *folder, void *data);
- void *data;
+ void (*done) (CamelFolder *folder, gpointer data);
+ gpointer data;
};
static gchar *
@@ -1582,7 +1582,7 @@ static MailMsgInfo sync_folder_info = {
};
void
-mail_sync_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, void *data), void *data)
+mail_sync_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, gpointer data), gpointer data)
{
struct _sync_folder_msg *m;
@@ -1601,15 +1601,15 @@ struct _sync_store_msg {
MailMsg base;
CamelStore *store;
- int expunge;
- void (*done) (CamelStore *store, void *data);
- void *data;
+ gint expunge;
+ void (*done) (CamelStore *store, gpointer data);
+ gpointer data;
};
static gchar *
sync_store_desc (struct _sync_store_msg *m)
{
- char *uri, *res;
+ gchar *uri, *res;
uri = camel_url_to_string(((CamelService *)m->store)->url, CAMEL_URL_HIDE_ALL);
res = g_strdup_printf(m->expunge
@@ -1649,7 +1649,7 @@ static MailMsgInfo sync_store_info = {
};
void
-mail_sync_store(CamelStore *store, int expunge, void (*done) (CamelStore *store, void *data), void *data)
+mail_sync_store(CamelStore *store, gint expunge, void (*done) (CamelStore *store, gpointer data), gpointer data)
{
struct _sync_store_msg *m;
@@ -1690,7 +1690,7 @@ static MailMsgInfo refresh_folder_info = {
};
void
-mail_refresh_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, void *data), void *data)
+mail_refresh_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, gpointer data), gpointer data)
{
struct _sync_folder_msg *m;
@@ -1727,7 +1727,7 @@ static MailMsgInfo expunge_folder_info = {
};
void
-mail_expunge_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, void *data), void *data)
+mail_expunge_folder(CamelFolder *folder, void (*done) (CamelFolder *folder, gpointer data), gpointer data)
{
struct _sync_folder_msg *m;
@@ -1746,8 +1746,8 @@ struct _empty_trash_msg {
MailMsg base;
EAccount *account;
- void (*done) (EAccount *account, void *data);
- void *data;
+ void (*done) (EAccount *account, gpointer data);
+ gpointer data;
};
static gchar *
@@ -1768,7 +1768,7 @@ empty_trash_exec (struct _empty_trash_msg *m)
EShellBackend *shell_backend;
const gchar *data_dir;
CamelFolder *trash;
- char *uri;
+ gchar *uri;
shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
@@ -1810,7 +1810,7 @@ static MailMsgInfo empty_trash_info = {
};
void
-mail_empty_trash(EAccount *account, void (*done) (EAccount *account, void *data), void *data)
+mail_empty_trash(EAccount *account, void (*done) (EAccount *account, gpointer data), gpointer data)
{
struct _empty_trash_msg *m;
@@ -1830,9 +1830,9 @@ struct _get_message_msg {
MailMsg base;
CamelFolder *folder;
- char *uid;
- void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data);
- void *data;
+ gchar *uid;
+ void (*done) (CamelFolder *folder, const gchar *uid, CamelMimeMessage *msg, gpointer data);
+ gpointer data;
CamelMimeMessage *message;
CamelOperation *cancel;
};
@@ -1876,9 +1876,9 @@ static MailMsgInfo get_message_info = {
};
void
-mail_get_message(CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, const char *uid,
- CamelMimeMessage *msg, void *data),
- void *data, MailMsgDispatchFunc dispatch)
+mail_get_message(CamelFolder *folder, const gchar *uid, void (*done) (CamelFolder *folder, const gchar *uid,
+ CamelMimeMessage *msg, gpointer data),
+ gpointer data, MailMsgDispatchFunc dispatch)
{
struct _get_message_msg *m;
@@ -1887,13 +1887,13 @@ mail_get_message(CamelFolder *folder, const char *uid, void (*done) (CamelFolder
camel_object_ref(folder);
m->uid = g_strdup(uid);
m->data = data;
- m->done = (void (*) (CamelFolder *, const char *, CamelMimeMessage *, void *)) done;
+ m->done = (void (*) (CamelFolder *, const gchar *, CamelMimeMessage *, gpointer )) done;
m->cancel = camel_operation_new(NULL, NULL);
dispatch (m);
}
-typedef void (*get_done)(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data, CamelException *);
+typedef void (*get_done)(CamelFolder *folder, const gchar *uid, CamelMimeMessage *msg, gpointer data, CamelException *);
static void
get_messagex_done (struct _get_message_msg *m)
@@ -1915,8 +1915,8 @@ static MailMsgInfo get_messagex_info = {
/* This is temporary, to avoid having to rewrite everything that uses
mail_get_message; it adds an exception argument to the callback */
CamelOperation *
-mail_get_messagex(CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data, CamelException *),
- void *data, MailMsgDispatchFunc dispatch)
+mail_get_messagex(CamelFolder *folder, const gchar *uid, void (*done) (CamelFolder *folder, const gchar *uid, CamelMimeMessage *msg, gpointer data, CamelException *),
+ gpointer data, MailMsgDispatchFunc dispatch)
{
struct _get_message_msg *m;
@@ -1925,7 +1925,7 @@ mail_get_messagex(CamelFolder *folder, const char *uid, void (*done) (CamelFolde
camel_object_ref(folder);
m->uid = g_strdup(uid);
m->data = data;
- m->done = (void (*) (CamelFolder *, const char *, CamelMimeMessage *, void *)) done;
+ m->done = (void (*) (CamelFolder *, const gchar *, CamelMimeMessage *, gpointer )) done;
m->cancel = camel_operation_new(NULL, NULL);
dispatch (m);
@@ -1942,8 +1942,8 @@ struct _get_messages_msg {
GPtrArray *uids;
GPtrArray *messages;
- void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, void *data);
- void *data;
+ void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, gpointer data);
+ gpointer data;
};
static gchar *
@@ -1957,11 +1957,11 @@ get_messages_desc (struct _get_messages_msg *m)
static void
get_messages_exec (struct _get_messages_msg *m)
{
- int i;
+ gint i;
CamelMimeMessage *message;
for (i=0; i<m->uids->len; i++) {
- int pc = ((i+1) * 100) / m->uids->len;
+ gint pc = ((i+1) * 100) / m->uids->len;
message = camel_folder_get_message(m->folder, m->uids->pdata[i], &m->base.ex);
camel_operation_progress(m->base.cancel, pc);
@@ -1982,7 +1982,7 @@ get_messages_done (struct _get_messages_msg *m)
static void
get_messages_free (struct _get_messages_msg *m)
{
- int i;
+ gint i;
em_utils_uids_free (m->uids);
for (i=0;i<m->messages->len;i++) {
@@ -2003,8 +2003,8 @@ static MailMsgInfo get_messages_info = {
void
mail_get_messages(CamelFolder *folder, GPtrArray *uids,
- void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, void *data),
- void *data)
+ void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, gpointer data),
+ gpointer data)
{
struct _get_messages_msg *m;
@@ -2026,9 +2026,9 @@ struct _save_messages_msg {
CamelFolder *folder;
GPtrArray *uids;
- char *path;
- void (*done)(CamelFolder *folder, GPtrArray *uids, char *path, void *data);
- void *data;
+ gchar *path;
+ void (*done)(CamelFolder *folder, GPtrArray *uids, gchar *path, gpointer data);
+ gpointer data;
};
static gchar *
@@ -2043,7 +2043,7 @@ static void
save_prepare_part (CamelMimePart *mime_part)
{
CamelDataWrapper *wrapper;
- int parts, i;
+ gint parts, i;
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part));
if (!wrapper)
@@ -2077,8 +2077,8 @@ save_messages_exec (struct _save_messages_msg *m)
CamelStreamFilter *filtered_stream;
CamelMimeFilterFrom *from_filter;
CamelStream *stream;
- int i;
- char *from, *path;
+ gint i;
+ gchar *from, *path;
if (strstr (m->path, "://"))
path = m->path;
@@ -2096,7 +2096,7 @@ save_messages_exec (struct _save_messages_msg *m)
for (i=0; i<m->uids->len; i++) {
CamelMimeMessage *message;
- int pc = ((i+1) * 100) / m->uids->len;
+ gint pc = ((i+1) * 100) / m->uids->len;
message = camel_folder_get_message(m->folder, m->uids->pdata[i], &m->base.ex);
camel_operation_progress(m->base.cancel, pc);
@@ -2148,12 +2148,12 @@ static MailMsgInfo save_messages_info = {
(MailMsgFreeFunc) save_messages_free
};
-int
-mail_save_messages(CamelFolder *folder, GPtrArray *uids, const char *path,
- void (*done) (CamelFolder *folder, GPtrArray *uids, char *path, void *data), void *data)
+gint
+mail_save_messages(CamelFolder *folder, GPtrArray *uids, const gchar *path,
+ void (*done) (CamelFolder *folder, GPtrArray *uids, gchar *path, gpointer data), gpointer data)
{
struct _save_messages_msg *m;
- int id;
+ gint id;
m = mail_msg_new(&save_messages_info);
m->folder = folder;
@@ -2175,9 +2175,9 @@ struct _save_part_msg {
MailMsg base;
CamelMimePart *part;
- char *path;
- void (*done)(CamelMimePart *part, char *path, int saved, void *data);
- void *data;
+ gchar *path;
+ void (*done)(CamelMimePart *part, gchar *path, gint saved, gpointer data);
+ gpointer data;
gboolean readonly;
};
@@ -2192,7 +2192,7 @@ save_part_exec (struct _save_part_msg *m)
{
CamelDataWrapper *content;
CamelStream *stream;
- char *path;
+ gchar *path;
if (strstr (m->path, "://"))
path = m->path;
@@ -2253,12 +2253,12 @@ static MailMsgInfo save_part_info = {
(MailMsgFreeFunc) save_part_free
};
-int
-mail_save_part (CamelMimePart *part, const char *path,
- void (*done)(CamelMimePart *part, char *path, int saved, void *data), void *data, gboolean readonly)
+gint
+mail_save_part (CamelMimePart *part, const gchar *path,
+ void (*done)(CamelMimePart *part, gchar *path, gint saved, gpointer data), gpointer data, gboolean readonly)
{
struct _save_part_msg *m;
- int id;
+ gint id;
m = mail_msg_new (&save_part_info);
m->part = part;
camel_object_ref (part);
@@ -2280,9 +2280,9 @@ struct _prep_offline_msg {
MailMsg base;
CamelOperation *cancel;
- char *uri;
- void (*done)(const char *uri, void *data);
- void *data;
+ gchar *uri;
+ void (*done)(const gchar *uri, gpointer data);
+ gpointer data;
};
static void
@@ -2336,10 +2336,10 @@ static MailMsgInfo prep_offline_info = {
};
void
-mail_prep_offline(const char *uri,
+mail_prep_offline(const gchar *uri,
CamelOperation *cancel,
- void (*done)(const char *, void *data),
- void *data)
+ void (*done)(const gchar *, gpointer data),
+ gpointer data)
{
struct _prep_offline_msg *m;
@@ -2361,15 +2361,15 @@ struct _set_offline_msg {
CamelStore *store;
gboolean offline;
- void (*done)(CamelStore *store, void *data);
- void *data;
+ void (*done)(CamelStore *store, gpointer data);
+ gpointer data;
};
static gchar *
set_offline_desc (struct _set_offline_msg *m)
{
- char *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE);
- char *msg;
+ gchar *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE);
+ gchar *msg;
msg = g_strdup_printf(m->offline?_("Disconnecting from %s"):_("Reconnecting to %s"),
service_name);
@@ -2432,13 +2432,13 @@ static MailMsgInfo set_offline_info = {
(MailMsgFreeFunc) set_offline_free
};
-int
+gint
mail_store_set_offline (CamelStore *store, gboolean offline,
- void (*done)(CamelStore *, void *data),
- void *data)
+ void (*done)(CamelStore *, gpointer data),
+ gpointer data)
{
struct _set_offline_msg *m;
- int id;
+ gint id;
/* Cancel any pending connect first so the set_offline_op
* thread won't get queued behind a hung connect op.
@@ -2461,11 +2461,11 @@ mail_store_set_offline (CamelStore *store, gboolean offline,
/* ** Prepare OFFLINE ***************************************************** */
-static char *
+static gchar *
prepare_offline_desc (struct _set_offline_msg *m)
{
- char *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE);
- char *msg;
+ gchar *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE);
+ gchar *msg;
msg = g_strdup_printf (_("Preparing account '%s' for offline"), service_name);
g_free(service_name);
@@ -2506,11 +2506,11 @@ static MailMsgInfo prepare_offline_info = {
(MailMsgFreeFunc) prepare_offline_free
};
-int
+gint
mail_store_prepare_offline (CamelStore *store)
{
struct _set_offline_msg *m;
- int id;
+ gint id;
/* Cancel any pending connect first so the set_offline_op
* thread won't get queued behind a hung connect op.
@@ -2530,7 +2530,7 @@ mail_store_prepare_offline (CamelStore *store)
/* ** Execute Shell Command ***************************************************** */
void
-mail_execute_shell_command (CamelFilterDriver *driver, int argc, char **argv, void *data)
+mail_execute_shell_command (CamelFilterDriver *driver, gint argc, gchar **argv, gpointer data)
{
if (argc <= 0)
return;
@@ -2542,12 +2542,12 @@ mail_execute_shell_command (CamelFilterDriver *driver, int argc, char **argv, vo
struct _check_msg {
MailMsg base;
- char *url;
+ gchar *url;
CamelProviderType type;
GList *authtypes;
- void (*done)(const char *url, CamelProviderType type, GList *types, void *data);
- void *data;
+ void (*done)(const gchar *url, CamelProviderType type, GList *types, gpointer data);
+ gpointer data;
};
static gchar *
@@ -2593,11 +2593,11 @@ static MailMsgInfo check_service_info = {
(MailMsgFreeFunc) check_service_free
};
-int
-mail_check_service(const char *url, CamelProviderType type, void (*done)(const char *url, CamelProviderType type, GList *authtypes, void *data), void *data)
+gint
+mail_check_service(const gchar *url, CamelProviderType type, void (*done)(const gchar *url, CamelProviderType type, GList *authtypes, gpointer data), gpointer data)
{
struct _check_msg *m;
- int id;
+ gint id;
m = mail_msg_new (&check_service_info);
m->url = g_strdup(url);