diff options
| author | Tor Lillqvist <tml@novell.com> | 2005-11-30 09:54:54 +0000 |
|---|---|---|
| committer | Tor Lillqvist <tml@src.gnome.org> | 2005-11-30 09:54:54 +0000 |
| commit | 934206b6ab4ee6a11940e649853d91c5efc00f0b (patch) | |
| tree | e27a7950c6e75c31892618eb46991c49598229a9 /camel/camel-provider.c | |
| parent | fef4ef16071ed9342cd8ffc1b245e5bcaaea3bd2 (diff) | |
| download | evolution-data-server-934206b6ab4ee6a11940e649853d91c5efc00f0b.tar.gz | |
Define O_BINARY as 0 on Unix. Add declarations for camel_read_socket() and
2005-11-30 Tor Lillqvist <tml@novell.com>
* camel-file-utils.h: Define O_BINARY as 0 on Unix. Add
declarations for camel_read_socket() and camel_write_socket(). (In
a not yet committed addition to camel-file-utils.c.)
* camel-block-file.c
* camel-certdb.c
* camel-data-cache.c
* camel-disco-diary.c
* camel-folder-summary.c
* camel-mime-parser.c
* camel-offline-journal.c
* camel-provider.c
* camel-session.c
* camel-store-summary.c
* camel-stream-fs.c
* camel-text-index.c
* camel-uid-cache.c
* camel-vee-store.c: Use gstdio wrappers for full non-ASCII
filename support on Windows.
* camel-block-file.c (key_file_use)
* camel-certdb.c (camel_certdb_save)
* camel-disco-diary.c (camel_disco_diary_new)
* camel-folder-summary.c (camel_folder_summary_load)
* camel-offline-journal.c (camel_offline_journal_construct)
* camel-store-summary.c (camel_store_summary_load,
camel_store_summary_save, camel_store_summary_header_load)
* camel-stream-fs.c (camel_stream_fs_new_with_name)
* camel-text-index.c (dump_raw)
* camel-uid-cache.c (camel_uid_cache_new, camel_uid_cache_save):
Open file in binary mode.
* camel-data-cache.c (data_cache_expire)
* camel-provider.c (camel_provider_init): Use GDir instead of
dirent API for portability and full non-ASCII filename support on
Windows.
* camel-folder-summary.c (camel_folder_summary_load): On Win32
unlink destination before attempting a rename.
* camel-mime-parser.c: Drop unused includes. Use
g_ascii_strcasecmp() instead of strcasecmp() for well-definedness,
and the other string being compared is an ASCII literal anyway.
* camel-provider.c (camel_provider_init) Use G_MODULE_SUFFIX
instead of hardcoding .so.
* camel-session.c (session_thread_wait): Use g_usleep() instead of
usleep() for portability.
* camel-utf8.c: Use g_htons() and g_ntohs() instead of htons() and
ntohs() for portability.
Diffstat (limited to 'camel/camel-provider.c')
| -rw-r--r-- | camel/camel-provider.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/camel/camel-provider.c b/camel/camel-provider.c index 95022332e..2c4c760ae 100644 --- a/camel/camel-provider.c +++ b/camel/camel-provider.c @@ -30,19 +30,22 @@ #endif #include <sys/types.h> -#include <dirent.h> #include <errno.h> #include <stdio.h> #include <string.h> +#include <glib.h> +#include <glib/gstdio.h> #include <gmodule.h> -#include "camel-provider.h" +#include "libedataserver/e-msgport.h" + #include "camel-exception.h" +#include "camel-i18n.h" +#include "camel-provider.h" #include "camel-string-utils.h" #include "camel-vee-store.h" -#include "libedataserver/e-msgport.h" -#include "camel-i18n.h" +#include "camel-private.h" /* table of CamelProviderModule's */ static GHashTable *module_table; @@ -100,8 +103,8 @@ provider_setup(void) void camel_provider_init (void) { - DIR *dir; - struct dirent *d; + GDir *dir; + const char *entry; char *p, *name, buf[80]; CamelProviderModule *m; static int loaded = 0; @@ -113,22 +116,22 @@ camel_provider_init (void) loaded = 1; - dir = opendir (CAMEL_PROVIDERDIR); + dir = g_dir_open (CAMEL_PROVIDERDIR, 0, NULL); if (!dir) { g_warning("Could not open camel provider directory (%s): %s", CAMEL_PROVIDERDIR, g_strerror (errno)); return; } - while ((d = readdir (dir))) { + while ((entry = g_dir_read_name (dir))) { FILE *fp; - p = strrchr (d->d_name, '.'); + p = strrchr (entry, '.'); if (!p || strcmp (p, ".urls") != 0) continue; - name = g_strdup_printf ("%s/%s", CAMEL_PROVIDERDIR, d->d_name); - fp = fopen (name, "r"); + name = g_strdup_printf ("%s/%s", CAMEL_PROVIDERDIR, entry); + fp = g_fopen (name, "r"); if (!fp) { g_warning ("Could not read provider info file %s: %s", name, g_strerror (errno)); @@ -137,7 +140,7 @@ camel_provider_init (void) } p = strrchr (name, '.'); - strcpy (p, ".so"); + strcpy (p, "." G_MODULE_SUFFIX); m = g_malloc0(sizeof(*m)); m->path = name; @@ -159,7 +162,7 @@ camel_provider_init (void) fclose (fp); } - closedir (dir); + g_dir_close (dir); } /** |
