summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-01-13 15:06:36 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-01-13 15:06:36 +0000
commit797e305b125b24c0e5998a92d8dd5a2534a82e6d (patch)
tree0e94e204cf507bfdaea0011ebb68ff206714e53e
parent8e868bf1dac3b99245cdaf9b99f9470603520c5d (diff)
downloadmailutils-797e305b125b24c0e5998a92d8dd5a2534a82e6d.tar.gz
mailutils-797e305b125b24c0e5998a92d8dd5a2534a82e6d.tar.bz2
Removed file_record
-rw-r--r--examples/mimetest.c1
-rw-r--r--include/mailutils/registrar.h3
-rw-r--r--mailbox/include/registrar0.h3
-rw-r--r--mailbox/mbox/folder.c30
4 files changed, 9 insertions, 28 deletions
diff --git a/examples/mimetest.c b/examples/mimetest.c
index 56d3687e8..3e692a7d4 100644
--- a/examples/mimetest.c
+++ b/examples/mimetest.c
@@ -83,7 +83,6 @@ main (int argc, char **argv)
{
list_t bookie;
registrar_get_list (&bookie);
- list_append (bookie, file_record);
list_append (bookie, imap_record);
list_append (bookie, mbox_record);
list_append (bookie, path_record);
diff --git a/include/mailutils/registrar.h b/include/mailutils/registrar.h
index f21fc5463..c9efe688a 100644
--- a/include/mailutils/registrar.h
+++ b/include/mailutils/registrar.h
@@ -91,8 +91,6 @@ extern record_t pop_record;
/* Local Mailbox Unix Mailbox, "mbox:" */
extern record_t mbox_record;
-/* Local Folder/Mailbox, "file:" */
-extern record_t file_record;
/* Local Folder/Mailbox, / */
extern record_t path_record;
/* Local MH, "mh:" */
@@ -109,7 +107,6 @@ extern record_t sendmail_record;
list_t bookie = 0;\
registrar_get_list (&bookie);\
list_append (bookie, path_record);\
- list_append (bookie, file_record);\
list_append (bookie, mbox_record);\
list_append (bookie, pop_record);\
list_append (bookie, imap_record);\
diff --git a/mailbox/include/registrar0.h b/mailbox/include/registrar0.h
index 2626e19fd..3602d2dec 100644
--- a/mailbox/include/registrar0.h
+++ b/mailbox/include/registrar0.h
@@ -56,9 +56,6 @@ extern int _folder_mbox_init __P ((folder_t));
#define MU_FILE_SCHEME "file:"
#define MU_FILE_SCHEME_LEN (sizeof (MU_FILE_SCHEME) - 1)
-extern int _url_file_init __P ((url_t));
-extern int _mailbox_file_init __P ((mailbox_t));
-extern int _folder_file_init __P ((folder_t));
#define MU_PATH_SCHEME "/"
#define MU_PATH_SCHEME_LEN (sizeof (MU_PATH_SCHEME) - 1)
diff --git a/mailbox/mbox/folder.c b/mailbox/mbox/folder.c
index 557277d48..e73d48490 100644
--- a/mailbox/mbox/folder.c
+++ b/mailbox/mbox/folder.c
@@ -57,32 +57,20 @@ static struct _record _mbox_record =
};
record_t mbox_record = &_mbox_record;
-static struct _record _file_record =
-{
- MU_FILE_SCHEME,
- _url_file_init, /* Mailbox init. */
- _mailbox_file_init, /* Mailbox init. */
- NULL, /* Mailer init. */
- _folder_mbox_init, /* Folder init. */
- NULL, /* No need for an owner. */
- NULL, /* _is_scheme method. */
- NULL, /* _get_url method. */
- NULL, /* _get_mailbox method. */
- NULL, /* _get_mailer method. */
- NULL /* _get_folder method. */
-};
-record_t file_record = &_file_record;
-
static int
_path_is_scheme (record_t record, const char *url)
{
- if (url
- && record->scheme
- && strncasecmp (record->scheme, url, strlen (record->scheme)) == 0)
+ const char *path;
+
+ if (!url || !record->scheme)
+ return 0;
+
+ if (mu_scheme_autodetect_p (url, &path))
+ /* implies if (strncmp (record->scheme, url, strlen(record->scheme)) == 0)*/
{
struct stat st;
- if (stat (url, &st) < 0)
+ if (stat (path, &st) < 0)
return 1; /* mailbox_open will complain */
return S_ISREG (st.st_mode) || S_ISCHR (st.st_mode);
@@ -94,7 +82,7 @@ static struct _record _path_record =
{
MU_PATH_SCHEME,
_url_path_init, /* Mailbox init. */
- _mailbox_file_init, /* Mailbox init. */
+ _mailbox_mbox_init, /* Mailbox init. */
NULL, /* Mailer init. */
_folder_mbox_init, /* Folder init. */
NULL, /* No need for an owner. */

Return to:

Send suggestions and report system problems to the System administrator.