Commit 1a118300 1a118300cf4076159fa93945313afabaeabad316 by Sergey Poznyakoff

(struct _record.priority): New member.

1 parent 61f8ede3
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2004, 2005 Free Software Foundation, Inc.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 5 modify it under the terms of the GNU Lesser General Public
...@@ -28,7 +28,7 @@ extern "C" { ...@@ -28,7 +28,7 @@ extern "C" {
28 /* Public Interface, to allow static initialization. */ 28 /* Public Interface, to allow static initialization. */
29 struct _record 29 struct _record
30 { 30 {
31 /* Should not be access directly but rather by the stub functions. */ 31 int priority; /* Higher priority records are scanned first */
32 const char *scheme; 32 const char *scheme;
33 int (*_url) __PMT ((url_t)); 33 int (*_url) __PMT ((url_t));
34 int (*_mailbox) __PMT ((mailbox_t)); 34 int (*_mailbox) __PMT ((mailbox_t));
...@@ -45,7 +45,10 @@ struct _record ...@@ -45,7 +45,10 @@ struct _record
45 }; 45 };
46 46
47 /* Registration. */ 47 /* Registration. */
48 extern int registrar_get_list __P ((list_t *)); 48 extern int registrar_get_iterator __P ((iterator_t *));
49 extern int registrar_get_list __P ((list_t *)) __attribute__ ((deprecated));
50
51 extern int registrar_lookup __P ((const char *name, record_t *precord));
49 extern int registrar_record __P ((record_t)); 52 extern int registrar_record __P ((record_t));
50 extern int unregistrar_record __P ((record_t)); 53 extern int unregistrar_record __P ((record_t));
51 54
...@@ -101,50 +104,51 @@ extern record_t mh_record; ...@@ -101,50 +104,51 @@ extern record_t mh_record;
101 /* Maildir, "maildir:" */ 104 /* Maildir, "maildir:" */
102 extern record_t maildir_record; 105 extern record_t maildir_record;
103 106
107 #define MU_IMAP_PRIO 100
108 #define MU_POP_PRIO 200
109 #define MU_MBOX_PRIO 300
110 #define MU_MH_PRIO 400
111 #define MU_MAILDIR_PRIO 500
112 #define MU_NNTP_PRIO 600
113 #define MU_PATH_PRIO 0
114
115 #define MU_SMTP_PRIO 10000
116 #define MU_SENDMAIL_PRIO 10000
117
104 /* SMTP mailer, "smtp://" */ 118 /* SMTP mailer, "smtp://" */
105 extern record_t smtp_record; 119 extern record_t smtp_record;
106 /* Sendmail, "sendmail:" */ 120 /* Sendmail, "sendmail:" */
107 extern record_t sendmail_record; 121 extern record_t sendmail_record;
108 122
109 #define mu_register_all_mbox_formats() do {\ 123 #define mu_register_all_mbox_formats() do {\
110 list_t bookie = 0;\ 124 registrar_record (path_record);\
111 registrar_get_list (&bookie);\ 125 registrar_record (mbox_record);\
112 list_append (bookie, path_record);\ 126 registrar_record (pop_record);\
113 list_append (bookie, mbox_record);\ 127 registrar_record (imap_record);\
114 list_append (bookie, pop_record);\ 128 registrar_record (mh_record);\
115 list_append (bookie, imap_record);\ 129 registrar_record (maildir_record);\
116 list_append (bookie, mh_record);\
117 list_append (bookie, maildir_record);\
118 } while (0) 130 } while (0)
119 131
120 #define mu_register_local_mbox_formats() do {\ 132 #define mu_register_local_mbox_formats() do {\
121 list_t bookie = 0;\ 133 registrar_record (path_record);\
122 registrar_get_list (&bookie);\ 134 registrar_record (mbox_record);\
123 list_append (bookie, path_record);\ 135 registrar_record (mh_record);\
124 list_append (bookie, mbox_record);\ 136 registrar_record (maildir_record);\
125 list_append (bookie, mh_record);\
126 list_append (bookie, maildir_record);\
127 } while (0) 137 } while (0)
128 138
129 #define mu_register_remote_mbox_formats() do {\ 139 #define mu_register_remote_mbox_formats() do {\
130 list_t bookie = 0;\ 140 registrar_record (pop_record);\
131 registrar_get_list (&bookie);\ 141 registrar_record (imap_record);\
132 list_append (bookie, pop_record);\ 142 registrar_record (nntp_record);\
133 list_append (bookie, imap_record);\
134 list_append (bookie, nntp_record);\
135 } while (0) 143 } while (0)
136 144
137 #define mu_register_all_mailer_formats() do {\ 145 #define mu_register_all_mailer_formats() do {\
138 list_t bookie = 0;\ 146 registrar_record (sendmail_record);\
139 registrar_get_list (&bookie);\ 147 registrar_record (smtp_record);\
140 list_append (bookie, sendmail_record);\
141 list_append (bookie, smtp_record);\
142 } while (0) 148 } while (0)
143 149
144 #define mu_register_extra_formats() do {\ 150 #define mu_register_extra_formats() do {\
145 list_t bookie = 0;\ 151 registrar_record (nntp_record);\
146 registrar_get_list (&bookie);\
147 list_append (bookie, nntp_record);\
148 } while (0) 152 } while (0)
149 153
150 #define mu_register_all_formats() do {\ 154 #define mu_register_all_formats() do {\
......