diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
commit | 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 (patch) | |
tree | 4133b1adfd94d8f889ca7ad4ad851346518f4171 /mail/importers/mail-importer.c | |
parent | cc3a98fc1ad5bb87aa7335f3de404ee7feee1541 (diff) | |
download | gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.gz gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.zst gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'mail/importers/mail-importer.c')
-rw-r--r-- | mail/importers/mail-importer.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index e56ca01dcd..5540a08abf 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -61,8 +61,8 @@ * Return value: The physical uri of the folder, or NULL if the folder did * not exist and could not be created. **/ -char * -mail_importer_make_local_folder(const char *folderpath) +gchar * +mail_importer_make_local_folder(const gchar *folderpath) { return g_strdup_printf("mbox:/home/notzed/.evolution/mail/local/%s", folderpath); } @@ -78,7 +78,7 @@ mail_importer_make_local_folder(const char *folderpath) */ void mail_importer_add_line (MailImporter *importer, - const char *str, + const gchar *str, gboolean finished) { CamelMimeMessage *msg; @@ -112,7 +112,7 @@ mail_importer_add_line (MailImporter *importer, camel_message_info_free(info); } -struct _BonoboObject *mail_importer_factory_cb(struct _BonoboGenericFactory *factory, const char *iid, void *data) +struct _BonoboObject *mail_importer_factory_cb(struct _BonoboGenericFactory *factory, const gchar *iid, gpointer data) { #if 0 if (strcmp(iid, ELM_INTELLIGENT_IMPORTER_IID) == 0) @@ -132,12 +132,12 @@ struct _BonoboObject *mail_importer_factory_cb(struct _BonoboGenericFactory *fac struct _import_mbox_msg { MailMsg base; - char *path; - char *uri; + gchar *path; + gchar *uri; CamelOperation *cancel; - void (*done)(void *data, CamelException *ex); - void *done_data; + void (*done)(gpointer data, CamelException *ex); + gpointer done_data; }; static gchar * @@ -147,7 +147,7 @@ import_mbox_desc (struct _import_mbox_msg *m) } static struct { - char tag; + gchar tag; guint32 mozflag; guint32 flag; } status_flags[] = { @@ -158,11 +158,11 @@ static struct { }; static guint32 -decode_status(const char *status) +decode_status(const gchar *status) { - const char *p; + const gchar *p; guint32 flags = 0; - int i; + gint i; p = status; while ((*p++)) { @@ -175,11 +175,11 @@ decode_status(const char *status) } static guint32 -decode_mozilla_status(const char *tmp) +decode_mozilla_status(const gchar *tmp) { unsigned long status = strtoul(tmp, NULL, 16); guint32 flags = 0; - int i; + gint i; for (i=0;i<sizeof(status_flags)/sizeof(status_flags[0]);i++) if (status_flags[i].mozflag & status) @@ -193,7 +193,7 @@ import_mbox_exec (struct _import_mbox_msg *m) CamelFolder *folder; CamelMimeParser *mp = NULL; struct stat st; - int fd; + gint fd; CamelMessageInfo *info; if (g_stat(m->path, &st) == -1) { @@ -232,8 +232,8 @@ import_mbox_exec (struct _import_mbox_msg *m) camel_folder_freeze(folder); while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) { CamelMimeMessage *msg; - const char *tmp; - int pc = 0; + const gchar *tmp; + gint pc = 0; guint32 flags = 0; if (st.st_size > 0) @@ -307,11 +307,11 @@ static MailMsgInfo import_mbox_info = { (MailMsgFreeFunc) import_mbox_free }; -int -mail_importer_import_mbox(const char *path, const char *folderuri, CamelOperation *cancel, void (*done)(void *data, CamelException *), void *data) +gint +mail_importer_import_mbox(const gchar *path, const gchar *folderuri, CamelOperation *cancel, void (*done)(gpointer data, CamelException *), gpointer data) { struct _import_mbox_msg *m; - int id; + gint id; m = mail_msg_new(&import_mbox_info); m->path = g_strdup(path); @@ -330,7 +330,7 @@ mail_importer_import_mbox(const char *path, const char *folderuri, CamelOperatio } void -mail_importer_import_mbox_sync(const char *path, const char *folderuri, CamelOperation *cancel) +mail_importer_import_mbox_sync(const gchar *path, const gchar *folderuri, CamelOperation *cancel) { struct _import_mbox_msg *m; @@ -355,15 +355,15 @@ struct _import_folders_data { }; static void -import_folders_rec(struct _import_folders_data *m, const char *filepath, const char *folderparent) +import_folders_rec(struct _import_folders_data *m, const gchar *filepath, const gchar *folderparent) { EShellBackend *shell_backend; GDir *dir; - const char *d; + const gchar *d; struct stat st; const gchar *data_dir; - char *filefull, *foldersub, *uri, *utf8_filename; - const char *folder; + gchar *filefull, *foldersub, *uri, *utf8_filename; + const gchar *folder; dir = g_dir_open(filepath, 0, NULL); if (dir == NULL) @@ -392,7 +392,7 @@ import_folders_rec(struct _import_folders_data *m, const char *filepath, const c folder = d; if (folderparent == NULL) { - int i; + gint i; for (i=0;m->special_folders[i].orig;i++) if (strcmp(m->special_folders[i].orig, folder) == 0) { @@ -411,7 +411,7 @@ import_folders_rec(struct _import_folders_data *m, const char *filepath, const c /* This little gem re-uses the stat buffer and filefull to automagically scan mozilla-format folders */ if (!m->elmfmt) { - char *tmp = g_strdup_printf("%s.sbd", filefull); + gchar *tmp = g_strdup_printf("%s.sbd", filefull); g_free(filefull); filefull = tmp; @@ -450,7 +450,7 @@ import_folders_rec(struct _import_folders_data *m, const char *filepath, const c * standard unix directories. **/ void -mail_importer_import_folders_sync(const char *filepath, MailImporterSpecial special_folders[], int flags, CamelOperation *cancel) +mail_importer_import_folders_sync(const gchar *filepath, MailImporterSpecial special_folders[], gint flags, CamelOperation *cancel) { struct _import_folders_data m; CamelOperation *oldcancel = NULL; |