Commit 324975fd 324975fdec9f928a1a5ba60347fa72e341021b41 by Sergey Poznyakoff

Use registrar_record instead of directly accessing registrar list.

1 parent 08f4f14c
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, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -193,11 +193,7 @@ sig_hup (int sig) ...@@ -193,11 +193,7 @@ sig_hup (int sig)
193 void 193 void
194 comsat_init () 194 comsat_init ()
195 { 195 {
196 list_t bookie; 196 registrar_record (path_record);
197
198 registrar_get_list (&bookie);
199 /* list_append (bookie, mbox_record); */
200 list_append (bookie, path_record);
201 197
202 gethostname (hostname, sizeof hostname); 198 gethostname (hostname, sizeof hostname);
203 199
......
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, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -81,14 +81,10 @@ main (int argc, char **argv) ...@@ -81,14 +81,10 @@ main (int argc, char **argv)
81 mailbox_name = argv[i]; 81 mailbox_name = argv[i];
82 82
83 /* Registration. */ 83 /* Registration. */
84 { 84 registrar_record (imap_record);
85 list_t bookie; 85 registrar_record (mbox_record);
86 registrar_get_list (&bookie); 86 registrar_record (path_record);
87 list_append (bookie, imap_record); 87 registrar_record (pop_record);
88 list_append (bookie, mbox_record);
89 list_append (bookie, path_record);
90 list_append (bookie, pop_record);
91 }
92 88
93 if ((ret = mailbox_create_default (&mbox, mailbox_name)) != 0) 89 if ((ret = mailbox_create_default (&mbox, mailbox_name)) != 0)
94 { 90 {
......
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, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -96,12 +96,8 @@ main (int argc, char *argv[]) ...@@ -96,12 +96,8 @@ main (int argc, char *argv[])
96 } 96 }
97 97
98 /* Register mailers. */ 98 /* Register mailers. */
99 { 99 registrar_record (smtp_record);
100 list_t bookie; 100 registrar_record (sendmail_record);
101 registrar_get_list (&bookie);
102 list_append (bookie, smtp_record);
103 list_append (bookie, sendmail_record);
104 }
105 101
106 if (optfrom) 102 if (optfrom)
107 { 103 {
......
...@@ -251,12 +251,9 @@ make_tmp (FILE *input, const char *from, char **tempfile) ...@@ -251,12 +251,9 @@ make_tmp (FILE *input, const char *from, char **tempfile)
251 void 251 void
252 register_handlers () 252 register_handlers ()
253 { 253 {
254 list_t bookie; 254 registrar_record (path_record);
255 255 registrar_record (sendmail_record);
256 registrar_get_list (&bookie); 256 registrar_record (smtp_record);
257 list_append (bookie, path_record);
258 list_append (bookie, sendmail_record);
259 list_append (bookie, smtp_record);
260 } 257 }
261 258
262 int 259 int
......
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, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 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
...@@ -82,24 +82,18 @@ static int ...@@ -82,24 +82,18 @@ static int
82 register_format (const char *name) 82 register_format (const char *name)
83 { 83 {
84 int status = 0; 84 int status = 0;
85 list_t reglist = NULL;
86
87 status = registrar_get_list (&reglist);
88 if (status)
89 return status;
90 85
91 if (!name) 86 if (!name)
92 { 87 {
93 struct format_record *table; 88 struct format_record *table;
94 for (table = format_table; table->name; table++) 89 for (table = format_table; table->name; table++)
95 list_append (reglist, *table->record); 90 registrar_record (*table->record);
96 status = 0;
97 } 91 }
98 else 92 else
99 { 93 {
100 record_t *record = find_format (format_table, name); 94 record_t *record = find_format (format_table, name);
101 if (record) 95 if (record)
102 status = list_append (reglist, *record); 96 status = registrar_record (*record);
103 else 97 else
104 status = EINVAL; 98 status = EINVAL;
105 } 99 }
...@@ -165,7 +159,6 @@ void ...@@ -165,7 +159,6 @@ void
165 mu_scm_init () 159 mu_scm_init ()
166 { 160 {
167 int i; 161 int i;
168 list_t lst;
169 162
170 _mu_scm_mailer = scm_makfrom0str ("sendmail:" _PATH_SENDMAIL); 163 _mu_scm_mailer = scm_makfrom0str ("sendmail:" _PATH_SENDMAIL);
171 mu_set_variable ("mu-mailer", _mu_scm_mailer); 164 mu_set_variable ("mu-mailer", _mu_scm_mailer);
...@@ -196,6 +189,5 @@ mu_scm_init () ...@@ -196,6 +189,5 @@ mu_scm_init ()
196 mu_scm_mime_init (); 189 mu_scm_mime_init ();
197 #include "mu_scm.x" 190 #include "mu_scm.x"
198 191
199 registrar_get_list (&lst); 192 registrar_record (path_record);
200 list_append (lst, path_record);
201 } 193 }
......
...@@ -373,15 +373,11 @@ main (int argc, char *argv[]) ...@@ -373,15 +373,11 @@ main (int argc, char *argv[])
373 } 373 }
374 374
375 /* Register local mbox formats. */ 375 /* Register local mbox formats. */
376 { 376 registrar_record (mbox_record);
377 list_t bookie; 377 registrar_record (path_record);
378 registrar_get_list (&bookie);
379 list_append (bookie, mbox_record);
380 list_append (bookie, path_record);
381 /* Possible supported mailers. */ 378 /* Possible supported mailers. */
382 list_append (bookie, sendmail_record); 379 registrar_record (sendmail_record);
383 list_append (bookie, smtp_record); 380 registrar_record (smtp_record);
384 }
385 381
386 if (make_tmp (from, &mbox)) 382 if (make_tmp (from, &mbox))
387 exit (exit_code); 383 exit (exit_code);
......
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, 2001, 2002, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation,
3 Inc.
3 4
4 GNU Mailutils is free software; you can redistribute it and/or modify 5 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
...@@ -159,11 +160,7 @@ main (int argc, char **argv) ...@@ -159,11 +160,7 @@ main (int argc, char **argv)
159 mu_init_nls (); 160 mu_init_nls ();
160 161
161 /* Register mailers. */ 162 /* Register mailers. */
162 { 163 registrar_record (smtp_record);
163 list_t bookie;
164 registrar_get_list (&bookie);
165 list_append (bookie, smtp_record);
166 }
167 164
168 MU_AUTH_REGISTER_ALL_MODULES(); 165 MU_AUTH_REGISTER_ALL_MODULES();
169 mu_argp_init (program_version, NULL); 166 mu_argp_init (program_version, NULL);
......