Commit 797e305b 797e305b125b24c0e5998a92d8dd5a2534a82e6d by Sergey Poznyakoff

Removed file_record

1 parent 8e868bf1
......@@ -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);
......
......@@ -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);\
......
......@@ -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)
......
......@@ -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. */
......