aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.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/em-utils.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/em-utils.c')
-rw-r--r--mail/em-utils.c212
1 files changed, 106 insertions, 106 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 9b2786904a..25943d62df 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -82,7 +82,7 @@
#include "e-mail-shell-backend.h"
-static void emu_save_part_done (CamelMimePart *part, char *name, int done, void *data);
+static void emu_save_part_done (CamelMimePart *part, gchar *name, gint done, gpointer data);
#define d(x)
@@ -101,11 +101,11 @@ static void emu_save_part_done (CamelMimePart *part, char *name, int done, void
* Returns %TRUE if the user clicks Yes or %FALSE otherwise.
**/
gboolean
-em_utils_prompt_user(GtkWindow *parent, const char *promptkey, const char *tag, const char *arg0, ...)
+em_utils_prompt_user(GtkWindow *parent, const gchar *promptkey, const gchar *tag, const gchar *arg0, ...)
{
GtkWidget *mbox, *check = NULL;
va_list ap;
- int button;
+ gint button;
GConfClient *gconf = mail_config_get_gconf_client();
if (promptkey
@@ -146,7 +146,7 @@ GPtrArray *
em_utils_uids_copy (GPtrArray *uids)
{
GPtrArray *copy;
- int i;
+ gint i;
copy = g_ptr_array_new ();
g_ptr_array_set_size (copy, uids->len);
@@ -166,7 +166,7 @@ em_utils_uids_copy (GPtrArray *uids)
void
em_utils_uids_free (GPtrArray *uids)
{
- int i;
+ gint i;
for (i = 0; i < uids->len; i++)
g_free (uids->pdata[i]);
@@ -253,7 +253,7 @@ em_utils_check_user_can_send_mail (GtkWindow *parent)
static GtkWidget *filter_editor = NULL;
static void
-em_filter_editor_response (GtkWidget *dialog, int button, gpointer user_data)
+em_filter_editor_response (GtkWidget *dialog, gint button, gpointer user_data)
{
EShellBackend *shell_backend;
EMFilterContext *fc;
@@ -262,7 +262,7 @@ em_filter_editor_response (GtkWidget *dialog, int button, gpointer user_data)
if (button == GTK_RESPONSE_OK) {
const gchar *data_dir;
- char *user;
+ gchar *user;
data_dir = e_shell_backend_get_data_dir (shell_backend);
fc = g_object_get_data ((GObject *) dialog, "context");
@@ -295,7 +295,7 @@ em_utils_edit_filters (GtkWidget *parent)
{
EShellBackend *shell_backend;
const gchar *data_dir;
- char *user, *system;
+ gchar *user, *system;
EMFilterContext *fc;
if (filter_editor) {
@@ -344,9 +344,9 @@ em_filename_make_safe (gchar *string)
gchar *p, *ts;
gunichar c;
#ifdef G_OS_WIN32
- const char *unsafe_chars = "/\":*?<>|\\#";
+ const gchar *unsafe_chars = "/\":*?<>|\\#";
#else
- const char *unsafe_chars = "/#";
+ const gchar *unsafe_chars = "/#";
#endif
g_return_if_fail (string != NULL);
@@ -398,7 +398,7 @@ emu_save_get_filename_for_part (CamelMimePart *part)
* Saves a mime part to disk (prompting the user for filename).
**/
void
-em_utils_save_part (GtkWindow *parent, const char *prompt, CamelMimePart *part)
+em_utils_save_part (GtkWindow *parent, const gchar *prompt, CamelMimePart *part)
{
GtkWidget *file_chooser;
const gchar *utf8_filename;
@@ -477,7 +477,7 @@ get_unique_file_names (GSList *parts)
sorted_file_names = g_slist_sort (g_slist_copy (file_names), cmp_func);
last = sorted_file_names->data;
for (iter = sorted_file_names->next; iter; iter = iter->next) {
- char *name = iter->data;
+ gchar *name = iter->data;
if (name && last && cmp_func (name, last) == 0) {
gchar *new_name;
@@ -573,10 +573,10 @@ exit:
* Returns %TRUE if saving succeeded, %FALSE otherwise
**/
gboolean
-em_utils_save_part_to_file(GtkWindow *parent, const char *filename, CamelMimePart *part)
+em_utils_save_part_to_file(GtkWindow *parent, const gchar *filename, CamelMimePart *part)
{
- int done;
- char *dirname;
+ gint done;
+ gchar *dirname;
struct stat st;
if (filename[0] == 0)
@@ -616,9 +616,9 @@ struct _save_messages_data {
};
static void
-emu_save_messages_response(GtkWidget *filesel, int response, struct _save_messages_data *data)
+emu_save_messages_response(GtkWidget *filesel, gint response, struct _save_messages_data *data)
{
- char *uri;
+ gchar *uri;
if (response == GTK_RESPONSE_OK) {
uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (filesel));
@@ -656,7 +656,7 @@ em_utils_save_messages (GtkWindow *parent, CamelFolder *folder, GPtrArray *uids)
{
struct _save_messages_data *data;
GtkWidget *filesel;
- char *filename = NULL;
+ gchar *filename = NULL;
CamelMessageInfo *info = NULL;
g_return_if_fail (GTK_IS_WINDOW (parent));
@@ -687,9 +687,9 @@ em_utils_save_messages (GtkWindow *parent, CamelFolder *folder, GPtrArray *uids)
/* ********************************************************************** */
static void
-emu_add_address_cb(BonoboListener *listener, const char *name, const CORBA_any *any, CORBA_Environment *ev, void *data)
+emu_add_address_cb(BonoboListener *listener, const gchar *name, const CORBA_any *any, CORBA_Environment *ev, gpointer data)
{
- char *type = bonobo_event_subtype(name);
+ gchar *type = bonobo_event_subtype(name);
if (!strcmp(type, "Destroy"))
gtk_widget_destroy((GtkWidget *)data);
@@ -699,12 +699,12 @@ emu_add_address_cb(BonoboListener *listener, const char *name, const CORBA_any *
/* one of email or vcard should be always NULL, never both of them */
static void
-emu_add_address_or_vcard (GtkWindow *parent, const char *email, const char *vcard)
+emu_add_address_or_vcard (GtkWindow *parent, const gchar *email, const gchar *vcard)
{
GtkWidget *win;
GtkWidget *control;
/*GtkWidget *socket;*/
- char *email_buf = NULL;
+ gchar *email_buf = NULL;
if (email) {
CamelInternetAddress *cia;
@@ -753,7 +753,7 @@ emu_add_address_or_vcard (GtkWindow *parent, const char *email, const char *vcar
* Add address @email to the addressbook.
**/
void
-em_utils_add_address (GtkWindow *parent, const char *email)
+em_utils_add_address (GtkWindow *parent, const gchar *email)
{
g_return_if_fail (GTK_IS_WINDOW (parent));
@@ -765,7 +765,7 @@ em_utils_add_address (GtkWindow *parent, const char *email)
* Adds whole vCard to the addressbook.
**/
void
-em_utils_add_vcard (GtkWindow *parent, const char *vcard)
+em_utils_add_vcard (GtkWindow *parent, const gchar *vcard)
{
g_return_if_fail (GTK_IS_WINDOW (parent));
@@ -792,12 +792,12 @@ ted_free (struct ted_t *ted)
}
static void
-tag_editor_response (GtkWidget *dialog, int button, struct ted_t *ted)
+tag_editor_response (GtkWidget *dialog, gint button, struct ted_t *ted)
{
CamelFolder *folder;
CamelTag *tags, *t;
GPtrArray *uids;
- int i;
+ gint i;
if (button == GTK_RESPONSE_OK && (tags = message_tag_editor_get_tag_list (ted->editor))) {
folder = ted->folder;
@@ -839,7 +839,7 @@ em_utils_flag_for_followup (GtkWindow *parent, CamelFolder *folder, GPtrArray *u
{
GtkWidget *editor;
struct ted_t *ted;
- int i;
+ gint i;
g_return_if_fail (GTK_IS_WINDOW (parent));
g_return_if_fail (CAMEL_IS_FOLDER (folder));
@@ -900,7 +900,7 @@ em_utils_flag_for_followup (GtkWindow *parent, CamelFolder *folder, GPtrArray *u
void
em_utils_flag_for_followup_clear (GtkWindow *parent, CamelFolder *folder, GPtrArray *uids)
{
- int i;
+ gint i;
g_return_if_fail (GTK_IS_WINDOW (parent));
g_return_if_fail (CAMEL_IS_FOLDER (folder));
@@ -935,8 +935,8 @@ em_utils_flag_for_followup_clear (GtkWindow *parent, CamelFolder *folder, GPtrAr
void
em_utils_flag_for_followup_completed (GtkWindow *parent, CamelFolder *folder, GPtrArray *uids)
{
- char *now;
- int i;
+ gchar *now;
+ gint i;
g_return_if_fail (GTK_IS_WINDOW (parent));
g_return_if_fail (CAMEL_IS_FOLDER (folder));
@@ -946,7 +946,7 @@ em_utils_flag_for_followup_completed (GtkWindow *parent, CamelFolder *folder, GP
camel_folder_freeze (folder);
for (i = 0; i < uids->len; i++) {
- const char *tag;
+ const gchar *tag;
CamelMessageInfo *mi = camel_folder_get_message_info(folder, uids->pdata[i]);
if (mi) {
@@ -974,7 +974,7 @@ em_utils_write_messages_to_stream(CamelFolder *folder, GPtrArray *uids, CamelStr
{
CamelStreamFilter *filtered_stream;
CamelMimeFilterFrom *from_filter;
- int i, res = 0;
+ gint i, res = 0;
from_filter = camel_mime_filter_from_new();
filtered_stream = camel_stream_filter_new_with_stream(stream);
@@ -983,7 +983,7 @@ em_utils_write_messages_to_stream(CamelFolder *folder, GPtrArray *uids, CamelStr
for (i=0; i<uids->len; i++) {
CamelMimeMessage *message;
- char *from;
+ gchar *from;
message = camel_folder_get_message(folder, uids->pdata[i], NULL);
if (message == NULL) {
@@ -1019,7 +1019,7 @@ em_utils_read_messages_from_stream(CamelFolder *folder, CamelStream *stream)
{
CamelException *ex = camel_exception_new();
CamelMimeParser *mp = camel_mime_parser_new();
- int res = -1;
+ gint res = -1;
camel_mime_parser_scan_from(mp, TRUE);
camel_mime_parser_init_with_stream(mp, stream);
@@ -1095,7 +1095,7 @@ em_utils_selection_get_mailbox(GtkSelectionData *data, CamelFolder *folder)
/* TODO: a stream mem with read-only access to existing data? */
/* NB: Although copying would let us run this async ... which it should */
- stream = (CamelStream *)camel_stream_mem_new_with_buffer((char *)data->data, data->length);
+ stream = (CamelStream *)camel_stream_mem_new_with_buffer((gchar *)data->data, data->length);
em_utils_read_messages_from_stream(folder, stream);
camel_object_unref(stream);
}
@@ -1118,7 +1118,7 @@ em_utils_selection_get_message(GtkSelectionData *data, CamelFolder *folder)
return;
ex = camel_exception_new();
- stream = (CamelStream *)camel_stream_mem_new_with_buffer((char *)data->data, data->length);
+ stream = (CamelStream *)camel_stream_mem_new_with_buffer((gchar *)data->data, data->length);
msg = camel_mime_message_new();
if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) == 0)
camel_folder_append_message(folder, msg, NULL, NULL, ex);
@@ -1138,14 +1138,14 @@ em_utils_selection_get_message(GtkSelectionData *data, CamelFolder *folder)
* FIXME: be nice if this could take a folder argument rather than uri
**/
void
-em_utils_selection_set_uidlist(GtkSelectionData *data, const char *uri, GPtrArray *uids)
+em_utils_selection_set_uidlist(GtkSelectionData *data, const gchar *uri, GPtrArray *uids)
{
GByteArray *array = g_byte_array_new();
- int i;
+ gint i;
/* format: "uri\0uid1\0uid2\0uid3\0...\0uidn\0" */
- g_byte_array_append(array, (unsigned char *)uri, strlen(uri)+1);
+ g_byte_array_append(array, (guchar *)uri, strlen(uri)+1);
for (i=0; i<uids->len; i++)
g_byte_array_append(array, uids->pdata[i], strlen(uids->pdata[i])+1);
@@ -1164,10 +1164,10 @@ em_utils_selection_set_uidlist(GtkSelectionData *data, const char *uri, GPtrArra
* Warning: Could take some time to run.
**/
void
-em_utils_selection_get_uidlist(GtkSelectionData *data, CamelFolder *dest, int move, CamelException *ex)
+em_utils_selection_get_uidlist(GtkSelectionData *data, CamelFolder *dest, gint move, CamelException *ex)
{
/* format: "uri\0uid1\0uid2\0uid3\0...\0uidn" */
- char *inptr, *inend;
+ gchar *inptr, *inend;
GPtrArray *uids;
CamelFolder *folder;
@@ -1176,15 +1176,15 @@ em_utils_selection_get_uidlist(GtkSelectionData *data, CamelFolder *dest, int mo
uids = g_ptr_array_new();
- inptr = (char *)data->data;
- inend = (char *)(data->data + data->length);
+ inptr = (gchar *)data->data;
+ inend = (gchar *)(data->data + data->length);
while (inptr < inend) {
- char *start = inptr;
+ gchar *start = inptr;
while (inptr < inend && *inptr)
inptr++;
- if (start > (char *)data->data)
+ if (start > (gchar *)data->data)
g_ptr_array_add(uids, g_strndup(start, inptr-start));
inptr++;
@@ -1195,7 +1195,7 @@ em_utils_selection_get_uidlist(GtkSelectionData *data, CamelFolder *dest, int mo
return;
}
- folder = mail_tool_uri_to_folder((char *)data->data, 0, ex);
+ folder = mail_tool_uri_to_folder((gchar *)data->data, 0, ex);
if (folder) {
camel_folder_transfer_messages_to(folder, uids, dest, NULL, move, ex);
camel_object_unref(folder);
@@ -1217,10 +1217,10 @@ em_utils_selection_get_uidlist(GtkSelectionData *data, CamelFolder *dest, int mo
void
em_utils_selection_set_urilist(GtkSelectionData *data, CamelFolder *folder, GPtrArray *uids)
{
- char *tmpdir;
+ gchar *tmpdir;
CamelStream *fstream;
- char *uri, *file = NULL, *tmpfile;
- int fd;
+ gchar *uri, *file = NULL, *tmpfile;
+ gint fd;
CamelMessageInfo *info;
tmpdir = e_mkdtemp("drag-n-drop-XXXXXX");
@@ -1260,9 +1260,9 @@ em_utils_selection_set_urilist(GtkSelectionData *data, CamelFolder *folder, GPtr
if (fstream) {
if (em_utils_write_messages_to_stream(folder, uids, fstream) == 0) {
/* terminate with \r\n to be compliant with the spec */
- char *uri_crlf = g_strconcat(uri, "\r\n", NULL);
+ gchar *uri_crlf = g_strconcat(uri, "\r\n", NULL);
- gtk_selection_data_set(data, data->target, 8, (unsigned char *)uri_crlf, strlen(uri_crlf));
+ gtk_selection_data_set(data, data->target, 8, (guchar *)uri_crlf, strlen(uri_crlf));
g_free(uri_crlf);
}
@@ -1288,12 +1288,12 @@ em_utils_selection_get_urilist(GtkSelectionData *data, CamelFolder *folder)
{
CamelStream *stream;
CamelURL *url;
- int fd, i, res = 0;
- char *tmp, **uris;
+ gint fd, i, res = 0;
+ gchar *tmp, **uris;
d(printf(" * drop uri list\n"));
- tmp = g_strndup((char *)data->data, data->length);
+ tmp = g_strndup((gchar *)data->data, data->length);
uris = g_strsplit(tmp, "\n", 0);
g_free(tmp);
for (i=0;res == 0 && uris[i];i++) {
@@ -1321,9 +1321,9 @@ em_utils_selection_get_urilist(GtkSelectionData *data, CamelFolder *folder)
}
static void
-emu_save_part_done(CamelMimePart *part, char *name, int done, void *data)
+emu_save_part_done(CamelMimePart *part, gchar *name, gint done, gpointer data)
{
- ((int *)data)[0] = done;
+ ((gint *)data)[0] = done;
}
/**
@@ -1337,12 +1337,12 @@ emu_save_part_done(CamelMimePart *part, char *name, int done, void *data)
*
* Return value: NULL if anything failed.
**/
-char *
+gchar *
em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode)
{
- const char *filename;
- char *tmpdir, *path, *utf8_mfilename = NULL, *mfilename = NULL;
- int done;
+ const gchar *filename;
+ gchar *tmpdir, *path, *utf8_mfilename = NULL, *mfilename = NULL;
+ gint done;
GtkWidget *w;
tmpdir = e_mkdtemp("evolution-tmp-XXXXXX");
@@ -1359,9 +1359,9 @@ em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode)
} else {
utf8_mfilename = g_strdup (filename);
e_filename_make_safe (utf8_mfilename);
- mfilename = g_filename_from_utf8 ((const char *) utf8_mfilename, -1, NULL, NULL, NULL);
+ mfilename = g_filename_from_utf8 ((const gchar *) utf8_mfilename, -1, NULL, NULL, NULL);
g_free (utf8_mfilename);
- filename = (const char *) mfilename;
+ filename = (const gchar *) mfilename;
}
path = g_build_filename(tmpdir, filename, NULL);
@@ -1392,14 +1392,14 @@ em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode)
**/
gboolean
-em_utils_folder_is_templates (CamelFolder *folder, const char *uri)
+em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri)
{
CamelFolder *local_templates_folder;
EAccountList *accounts;
EAccount *account;
EIterator *iter;
- int is = FALSE;
- char *templates_uri;
+ gint is = FALSE;
+ gchar *templates_uri;
local_templates_folder = e_mail_shell_backend_get_folder (
global_mail_shell_backend, E_MAIL_FOLDER_TEMPLATES);
@@ -1443,14 +1443,14 @@ em_utils_folder_is_templates (CamelFolder *folder, const char *uri)
* Returns %TRUE if this is a Drafts folder or %FALSE otherwise.
**/
gboolean
-em_utils_folder_is_drafts(CamelFolder *folder, const char *uri)
+em_utils_folder_is_drafts(CamelFolder *folder, const gchar *uri)
{
CamelFolder *local_drafts_folder;
EAccountList *accounts;
EAccount *account;
EIterator *iter;
- int is = FALSE;
- char *drafts_uri;
+ gint is = FALSE;
+ gchar *drafts_uri;
local_drafts_folder = e_mail_shell_backend_get_folder (
global_mail_shell_backend, E_MAIL_FOLDER_DRAFTS);
@@ -1494,14 +1494,14 @@ em_utils_folder_is_drafts(CamelFolder *folder, const char *uri)
* Returns %TRUE if this is a Sent folder or %FALSE otherwise.
**/
gboolean
-em_utils_folder_is_sent(CamelFolder *folder, const char *uri)
+em_utils_folder_is_sent(CamelFolder *folder, const gchar *uri)
{
CamelFolder *local_sent_folder;
EAccountList *accounts;
EAccount *account;
EIterator *iter;
- int is = FALSE;
- char *sent_uri;
+ gint is = FALSE;
+ gchar *sent_uri;
local_sent_folder = e_mail_shell_backend_get_folder (
global_mail_shell_backend, E_MAIL_FOLDER_SENT);
@@ -1545,7 +1545,7 @@ em_utils_folder_is_sent(CamelFolder *folder, const char *uri)
* Returns %TRUE if this is an Outbox folder or %FALSE otherwise.
**/
gboolean
-em_utils_folder_is_outbox(CamelFolder *folder, const char *uri)
+em_utils_folder_is_outbox(CamelFolder *folder, const gchar *uri)
{
CamelFolder *local_outbox_folder;
@@ -1589,8 +1589,8 @@ em_utils_adjustment_page(GtkAdjustment *adj, gboolean down)
static EProxy *emu_proxy = NULL;
static GStaticMutex emu_proxy_lock = G_STATIC_MUTEX_INIT;
-static void *
-emu_proxy_setup (void *data)
+static gpointer
+emu_proxy_setup (gpointer data)
{
if (!emu_proxy) {
emu_proxy = e_proxy_new ();
@@ -1608,10 +1608,10 @@ emu_proxy_setup (void *data)
*
* Return value: Must be freed when finished with.
**/
-char *
-em_utils_get_proxy_uri (const char *pUri)
+gchar *
+em_utils_get_proxy_uri (const gchar *pUri)
{
- char *uri = NULL;
+ gchar *uri = NULL;
g_static_mutex_lock (&emu_proxy_lock);
@@ -1641,13 +1641,13 @@ em_utils_get_proxy_uri (const char *pUri)
*
* Return value: The html version.
**/
-char *
-em_utils_message_to_html(CamelMimeMessage *message, const char *credits, guint32 flags, ssize_t *len, EMFormat *source, const char *append)
+gchar *
+em_utils_message_to_html(CamelMimeMessage *message, const gchar *credits, guint32 flags, ssize_t *len, EMFormat *source, const gchar *append)
{
EMFormatQuote *emfq;
CamelStreamMem *mem;
GByteArray *buf;
- char *text;
+ gchar *text;
buf = g_byte_array_new ();
mem = (CamelStreamMem *) camel_stream_mem_new ();
@@ -1658,7 +1658,7 @@ em_utils_message_to_html(CamelMimeMessage *message, const char *credits, guint32
if (!source) {
GConfClient *gconf;
- char *charset;
+ gchar *charset;
/* FIXME: we should be getting this from the current view, not the global setting. */
gconf = gconf_client_get_default ();
@@ -1677,7 +1677,7 @@ em_utils_message_to_html(CamelMimeMessage *message, const char *credits, guint32
camel_stream_write((CamelStream *)mem, "", 1);
camel_object_unref(mem);
- text = (char *)buf->data;
+ text = (gchar *)buf->data;
if (len)
*len = buf->len-1;
g_byte_array_free(buf, FALSE);
@@ -1697,7 +1697,7 @@ em_utils_message_to_html(CamelMimeMessage *message, const char *credits, guint32
void
em_utils_expunge_folder (GtkWidget *parent, CamelFolder *folder)
{
- char *name;
+ gchar *name;
camel_object_get(folder, NULL, CAMEL_OBJECT_DESCRIPTION, &name, 0);
@@ -1757,11 +1757,11 @@ em_utils_empty_trash (GtkWidget *parent)
mail_empty_trash (NULL, NULL, NULL);
}
-char *
-em_utils_folder_name_from_uri (const char *uri)
+gchar *
+em_utils_folder_name_from_uri (const gchar *uri)
{
CamelURL *url;
- char *folder_name = NULL;
+ gchar *folder_name = NULL;
if (uri == NULL || (url = camel_url_new (uri, NULL)) == NULL)
return NULL;
@@ -1790,12 +1790,12 @@ em_utils_folder_name_from_uri (const char *uri)
* local local:/storage/path#folder -> email://local@local/folder
*/
-char *em_uri_from_camel(const char *curi)
+gchar *em_uri_from_camel(const gchar *curi)
{
CamelURL *curl;
EAccount *account;
- const char *uid, *path;
- char *euri, *tmp;
+ const gchar *uid, *path;
+ gchar *euri, *tmp;
CamelProvider *provider;
CamelException ex;
@@ -1841,14 +1841,14 @@ char *em_uri_from_camel(const char *curi)
return euri;
}
-char *em_uri_to_camel(const char *euri)
+gchar *em_uri_to_camel(const gchar *euri)
{
EAccountList *accounts;
const EAccount *account;
EAccountService *service;
CamelProvider *provider;
CamelURL *eurl, *curl;
- char *uid, *curi;
+ gchar *uid, *curi;
if (strncmp(euri, "email:", 6) != 0) {
d(printf("em uri to camel not euri '%s'\n", euri));
@@ -1865,7 +1865,7 @@ char *em_uri_to_camel(const char *euri)
/* Sigh, shoul'dve used mbox@local for mailboxes, not local@local */
if (strcmp(eurl->host, "local") == 0
&& (strcmp(eurl->user, "local") == 0 || strcmp(eurl->user, "vfolder") == 0)) {
- char *base;
+ gchar *base;
if (strcmp(eurl->user, "vfolder") == 0)
curl = camel_url_new("vfolder:", NULL);
@@ -1876,7 +1876,7 @@ char *em_uri_to_camel(const char *euri)
#ifdef G_OS_WIN32
/* Turn backslashes into slashes to avoid URI encoding */
{
- char *p = base;
+ gchar *p = base;
while ((p = strchr (p, '\\')))
*p++ = '/';
}
@@ -1931,9 +1931,9 @@ char *em_uri_to_camel(const char *euri)
#include <libebook/e-book.h>
struct _addr_node {
- char *addr;
+ gchar *addr;
time_t stamp;
- int found;
+ gint found;
};
#define EMU_ADDR_CACHE_TIME (60*30) /* in seconds */
@@ -1943,8 +1943,8 @@ static ESourceList *emu_addr_list;
static GHashTable *emu_addr_cache;
/* runs sync, in main thread */
-static void *
-emu_addr_setup(void *dummy)
+static gpointer
+emu_addr_setup(gpointer dummy)
{
GError *err = NULL;
@@ -1957,7 +1957,7 @@ emu_addr_setup(void *dummy)
}
static void
-emu_addr_cancel_book(void *data)
+emu_addr_cancel_book(gpointer data)
{
EBook *book = data;
GError *err = NULL;
@@ -2052,9 +2052,9 @@ em_utils_in_addressbook (CamelInternetAddress *iaddr, gboolean local_only)
{
GError *err = NULL;
GSList *s, *g, *addr_sources = NULL;
- int stop = FALSE, found = FALSE;
+ gint stop = FALSE, found = FALSE;
EBookQuery *query;
- const char *addr;
+ const gchar *addr;
struct _addr_node *node;
time_t now;
@@ -2104,7 +2104,7 @@ em_utils_in_addressbook (CamelInternetAddress *iaddr, gboolean local_only)
for (s = e_source_group_peek_sources((ESourceGroup *)g->data);s;s=g_slist_next(s)) {
ESource *src = s->data;
- const char *completion = e_source_get_property (src, "completion");
+ const gchar *completion = e_source_get_property (src, "completion");
if (completion && !g_ascii_strcasecmp (completion, "true")) {
addr_sources = g_slist_prepend(addr_sources, src);
@@ -2179,8 +2179,8 @@ em_utils_in_addressbook (CamelInternetAddress *iaddr, gboolean local_only)
struct _CamelMimePart *
em_utils_contact_photo (struct _CamelInternetAddress *cia, gboolean local)
{
- const char *addr;
- int stop = FALSE, found = FALSE;
+ const gchar *addr;
+ gint stop = FALSE, found = FALSE;
GSList *s, *g, *addr_sources = NULL;
GError *err = NULL;
EBookQuery *query = NULL;
@@ -2209,7 +2209,7 @@ em_utils_contact_photo (struct _CamelInternetAddress *cia, gboolean local)
for (s = e_source_group_peek_sources((ESourceGroup *)g->data); s; s=g_slist_next(s)) {
ESource *src = s->data;
- const char *completion = e_source_get_property (src, "completion");
+ const gchar *completion = e_source_get_property (src, "completion");
if (completion && !g_ascii_strcasecmp (completion, "true")) {
addr_sources = g_slist_prepend(addr_sources, src);
@@ -2274,7 +2274,7 @@ em_utils_contact_photo (struct _CamelInternetAddress *cia, gboolean local)
/* Form a mime part out of the photo */
part = camel_mime_part_new();
camel_mime_part_set_content(part,
- (const char *) photo->data.inlined.data,
+ (const gchar *) photo->data.inlined.data,
photo->data.inlined.length, "image/jpeg");
e_contact_photo_free (photo);
@@ -2348,7 +2348,7 @@ gchar *
em_utils_url_unescape_amp (const gchar *url)
{
gchar *buff;
- int i, j, amps;
+ gint i, j, amps;
if (!url)
return NULL;