Commit 9e1c564f 9e1c564f2c769245d11439dfccd0af05b685e171 by Sergey Poznyakoff

Replace iterator_create with list_get_iterator.

1 parent 7ecfd2ab
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2003 Free Software Foundation, Inc. 2 Copyright (C) 2003, 2004 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
...@@ -41,9 +41,9 @@ print (list_t list) ...@@ -41,9 +41,9 @@ print (list_t list)
41 iterator_t itr; 41 iterator_t itr;
42 int rc; 42 int rc;
43 43
44 rc = iterator_create (&itr, list); 44 rc = list_get_iterator (list, &itr);
45 if (rc) 45 if (rc)
46 lperror ("iterator_create", rc); 46 lperror ("list_get_iterator", rc);
47 47
48 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 48 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
49 { 49 {
...@@ -222,9 +222,9 @@ shell (list_t list) ...@@ -222,9 +222,9 @@ shell (list_t list)
222 222
223 for (num = 0; num < NITR; num++) 223 for (num = 0; num < NITR; num++)
224 { 224 {
225 rc = iterator_create (&itr[num], list); 225 rc = list_get_iterator (list, &itr[num]);
226 if (rc) 226 if (rc)
227 lperror ("iterator_create", rc); 227 lperror ("list_get_iterator", rc);
228 iterator_first (itr[num]); 228 iterator_first (itr[num]);
229 } 229 }
230 230
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
2 GNU Mailutils nntp functions. This application interactively allows users 2 GNU Mailutils nntp functions. This application interactively allows users
3 to contact a nntp server. 3 to contact a nntp server.
4 4
5 Copyright (C) 2003, 2004 Free Software Foundation
6
5 GNU Mailutils is free software; you can redistribute it and/or modify 7 GNU Mailutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option) 9 the Free Software Foundation; either version 2, or (at your option)
...@@ -497,7 +499,7 @@ com_list_extensions (char *arg ARG_UNUSED) ...@@ -497,7 +499,7 @@ com_list_extensions (char *arg ARG_UNUSED)
497 if (status == 0) 499 if (status == 0)
498 { 500 {
499 iterator_t iterator = NULL; 501 iterator_t iterator = NULL;
500 iterator_create (&iterator, list); 502 list_get_iterator (list, &iterator);
501 for (iterator_first (iterator); 503 for (iterator_first (iterator);
502 !iterator_is_done (iterator); iterator_next (iterator)) 504 !iterator_is_done (iterator); iterator_next (iterator))
503 { 505 {
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
2 GNU Mailutils pop3 functions. This application interactively allows users 2 GNU Mailutils pop3 functions. This application interactively allows users
3 to contact a pop3 server. 3 to contact a pop3 server.
4 4
5 Copyright (C) 2003, 2004 Free Software Foundation
6
5 GNU Mailutils is free software; you can redistribute it and/or modify 7 GNU Mailutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option) 9 the Free Software Foundation; either version 2, or (at your option)
...@@ -404,7 +406,7 @@ com_capa (char *arg ARG_UNUSED) ...@@ -404,7 +406,7 @@ com_capa (char *arg ARG_UNUSED)
404 if (status == 0) 406 if (status == 0)
405 { 407 {
406 iterator_t iterator = NULL; 408 iterator_t iterator = NULL;
407 iterator_create (&iterator, list); 409 list_get_iterator (list, &iterator);
408 for (iterator_first (iterator); 410 for (iterator_first (iterator);
409 !iterator_is_done (iterator); iterator_next (iterator)) 411 !iterator_is_done (iterator); iterator_next (iterator))
410 { 412 {
...@@ -429,7 +431,7 @@ com_uidl (char *arg) ...@@ -429,7 +431,7 @@ com_uidl (char *arg)
429 if (status == 0) 431 if (status == 0)
430 { 432 {
431 iterator_t uidl_iterator = NULL; 433 iterator_t uidl_iterator = NULL;
432 iterator_create (&uidl_iterator, list); 434 list_get_iterator (list, &uidl_iterator);
433 for (iterator_first (uidl_iterator); 435 for (iterator_first (uidl_iterator);
434 !iterator_is_done (uidl_iterator); 436 !iterator_is_done (uidl_iterator);
435 iterator_next (uidl_iterator)) 437 iterator_next (uidl_iterator))
...@@ -465,7 +467,7 @@ com_list (char *arg) ...@@ -465,7 +467,7 @@ com_list (char *arg)
465 if (status == 0) 467 if (status == 0)
466 { 468 {
467 iterator_t list_iterator; 469 iterator_t list_iterator;
468 iterator_create (&list_iterator, list); 470 list_get_iterator (list, &list_iterator);
469 for (iterator_first (list_iterator); 471 for (iterator_first (list_iterator);
470 !iterator_is_done (list_iterator); 472 !iterator_is_done (list_iterator);
471 iterator_next (list_iterator)) 473 iterator_next (list_iterator))
......
...@@ -1237,7 +1237,7 @@ util_run_events (int old_state, int new_state) ...@@ -1237,7 +1237,7 @@ util_run_events (int old_state, int new_state)
1237 ev.old_state = old_state; 1237 ev.old_state = old_state;
1238 ev.new_state = new_state; 1238 ev.new_state = new_state;
1239 1239
1240 iterator_create (&itr, event_list); 1240 list_get_iterator (event_list, &itr);
1241 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 1241 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
1242 { 1242 {
1243 struct state_event *p; 1243 struct state_event *p;
......
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, 2004 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
...@@ -69,7 +69,7 @@ _lookup (list_t list, const char *name) ...@@ -69,7 +69,7 @@ _lookup (list_t list, const char *name)
69 iterator_t itr; 69 iterator_t itr;
70 sieve_comparator_record_t *reg; 70 sieve_comparator_record_t *reg;
71 71
72 if (!list || iterator_create (&itr, list)) 72 if (!list || list_get_iterator (list, &itr))
73 return NULL; 73 return NULL;
74 74
75 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 75 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
...@@ -215,7 +215,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args) ...@@ -215,7 +215,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
215 int matchtype; 215 int matchtype;
216 int err = 0; 216 int err = 0;
217 217
218 if (!tags || iterator_create (&itr, tags)) 218 if (!tags || list_get_iterator (tags, &itr))
219 return 0; 219 return 0;
220 220
221 for (iterator_first (itr); !err && !iterator_is_done (itr); 221 for (iterator_first (itr); !err && !iterator_is_done (itr);
......
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, 2004 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
...@@ -149,7 +149,7 @@ sieve_code_command (sieve_register_t *reg, list_t arglist) ...@@ -149,7 +149,7 @@ sieve_code_command (sieve_register_t *reg, list_t arglist)
149 149
150 if (arglist) 150 if (arglist)
151 { 151 {
152 rc = iterator_create (&itr, arglist); 152 rc = list_get_iterator (arglist, &itr);
153 153
154 if (rc) 154 if (rc)
155 { 155 {
......
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, 2004 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
...@@ -31,7 +31,7 @@ reg_lookup (list_t list, const char *name) ...@@ -31,7 +31,7 @@ reg_lookup (list_t list, const char *name)
31 iterator_t itr; 31 iterator_t itr;
32 sieve_register_t *reg; 32 sieve_register_t *reg;
33 33
34 if (!list || iterator_create (&itr, list)) 34 if (!list || list_get_iterator (list, &itr))
35 return NULL; 35 return NULL;
36 36
37 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 37 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
......
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, 2004 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
...@@ -31,7 +31,7 @@ sieve_require (list_t slist) ...@@ -31,7 +31,7 @@ sieve_require (list_t slist)
31 int status; 31 int status;
32 iterator_t itr; 32 iterator_t itr;
33 33
34 status = iterator_create (&itr, slist); 34 status = list_get_iterator (slist, &itr);
35 if (status) 35 if (status)
36 { 36 {
37 sieve_compile_error (sieve_filename, sieve_line_num, 37 sieve_compile_error (sieve_filename, sieve_line_num,
......
1 %{ 1 %{
2 /* GNU Mailutils -- a suite of utilities for electronic mail 2 /* GNU Mailutils -- a suite of utilities for electronic mail
3 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 3 Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public 6 modify it under the terms of the GNU Lesser General Public
...@@ -677,7 +677,7 @@ line_finish () ...@@ -677,7 +677,7 @@ line_finish ()
677 int length = 0; 677 int length = 0;
678 char *p; 678 char *p;
679 679
680 if (!string_list || iterator_create (&itr, string_list)) 680 if (!string_list || list_get_iterator (string_list, &itr))
681 return; 681 return;
682 682
683 /* Count number of characters in the multiline */ 683 /* Count number of characters in the multiline */
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2002, 2004 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
...@@ -144,7 +144,7 @@ get_sender_address (message_t msg) ...@@ -144,7 +144,7 @@ get_sender_address (message_t msg)
144 if (message_get_header (msg, &header)) 144 if (message_get_header (msg, &header))
145 return NULL; 145 return NULL;
146 146
147 if (!sender_headers || iterator_create (&itr, sender_headers)) 147 if (!sender_headers || list_get_iterator (sender_headers, &itr))
148 return NULL; 148 return NULL;
149 149
150 for (iterator_first (itr); !addr && !iterator_is_done (itr); 150 for (iterator_first (itr); !addr && !iterator_is_done (itr);
......
...@@ -698,7 +698,7 @@ util_slist_print (list_t list, int nl) ...@@ -698,7 +698,7 @@ util_slist_print (list_t list, int nl)
698 iterator_t itr; 698 iterator_t itr;
699 char *name; 699 char *name;
700 700
701 if (!list || iterator_create (&itr, list)) 701 if (!list || list_get_iterator (list, &itr))
702 return; 702 return;
703 703
704 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 704 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
...@@ -717,7 +717,7 @@ util_slist_lookup (list_t list, char *str) ...@@ -717,7 +717,7 @@ util_slist_lookup (list_t list, char *str)
717 char *name; 717 char *name;
718 int rc = 0; 718 int rc = 0;
719 719
720 if (!list || iterator_create (&itr, list)) 720 if (!list || list_get_iterator (list, &itr))
721 return 0; 721 return 0;
722 722
723 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 723 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
...@@ -773,7 +773,7 @@ util_slist_destroy (list_t *list) ...@@ -773,7 +773,7 @@ util_slist_destroy (list_t *list)
773 iterator_t itr; 773 iterator_t itr;
774 char *name; 774 char *name;
775 775
776 if (!*list || iterator_create (&itr, *list)) 776 if (!*list || list_get_iterator (*list, &itr))
777 return; 777 return;
778 778
779 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 779 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
...@@ -792,7 +792,7 @@ util_slist_to_string (list_t list, const char *delim) ...@@ -792,7 +792,7 @@ util_slist_to_string (list_t list, const char *delim)
792 char *name; 792 char *name;
793 char *str = NULL; 793 char *str = NULL;
794 794
795 if (!list || iterator_create (&itr, list)) 795 if (!list || list_get_iterator (list, &itr))
796 return NULL; 796 return NULL;
797 797
798 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 798 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
......
...@@ -173,7 +173,7 @@ filter_create (stream_t *pstream, stream_t stream, const char *name, ...@@ -173,7 +173,7 @@ filter_create (stream_t *pstream, stream_t stream, const char *name,
173 return EINVAL; 173 return EINVAL;
174 174
175 filter_get_list (&list); 175 filter_get_list (&list);
176 status = iterator_create (&iterator, list); 176 status = list_get_iterator (list, &iterator);
177 if (status != 0) 177 if (status != 0)
178 return status; 178 return status;
179 179
......
...@@ -67,7 +67,7 @@ folder_create (folder_t *pfolder, const char *name) ...@@ -67,7 +67,7 @@ folder_create (folder_t *pfolder, const char *name)
67 /* Look in the registrar list(iterator), for a possible concrete mailbox 67 /* Look in the registrar list(iterator), for a possible concrete mailbox
68 implementatio that could match the URL. */ 68 implementatio that could match the URL. */
69 registrar_get_list (&list); 69 registrar_get_list (&list);
70 status = iterator_create (&iterator, list); 70 status = list_get_iterator (list, &iterator);
71 if (status != 0) 71 if (status != 0)
72 return status; 72 return status;
73 for (iterator_first (iterator); !iterator_is_done (iterator); 73 for (iterator_first (iterator); !iterator_is_done (iterator);
...@@ -418,7 +418,7 @@ is_known_folder (url_t url, folder_t *pfolder) ...@@ -418,7 +418,7 @@ is_known_folder (url_t url, folder_t *pfolder)
418 if (url == NULL || pfolder == NULL) 418 if (url == NULL || pfolder == NULL)
419 return ret; 419 return ret;
420 420
421 if (iterator_create (&iterator, known_folder_list) != 0) 421 if (list_get_iterator (known_folder_list, &iterator) != 0)
422 return ret; 422 return ret;
423 423
424 for (iterator_first (iterator); !iterator_is_done (iterator); 424 for (iterator_first (iterator); !iterator_is_done (iterator);
......
...@@ -58,7 +58,7 @@ mailbox_create (mailbox_t *pmbox, const char *name) ...@@ -58,7 +58,7 @@ mailbox_create (mailbox_t *pmbox, const char *name)
58 58
59 /* Look in the registrar, for a match */ 59 /* Look in the registrar, for a match */
60 registrar_get_list (&list); 60 registrar_get_list (&list);
61 status = iterator_create (&iterator, list); 61 status = list_get_iterator (list, &iterator);
62 if (status != 0) 62 if (status != 0)
63 return status; 63 return status;
64 for (iterator_first (iterator); !iterator_is_done (iterator); 64 for (iterator_first (iterator); !iterator_is_done (iterator);
......
...@@ -98,7 +98,7 @@ mailer_create (mailer_t * pmailer, const char *name) ...@@ -98,7 +98,7 @@ mailer_create (mailer_t * pmailer, const char *name)
98 mailer_get_url_default (&name); 98 mailer_get_url_default (&name);
99 99
100 registrar_get_list (&list); 100 registrar_get_list (&list);
101 status = iterator_create (&iterator, list); 101 status = list_get_iterator (list, &iterator);
102 if (status != 0) 102 if (status != 0)
103 return status; 103 return status;
104 for (iterator_first (iterator); !iterator_is_done (iterator); 104 for (iterator_first (iterator); !iterator_is_done (iterator);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2002 Free Software Foundation, Inc. 2 Copyright (C) 2002, 2004 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
...@@ -129,7 +129,7 @@ mu_auth_runlist (list_t flist, struct mu_auth_data **return_data, ...@@ -129,7 +129,7 @@ mu_auth_runlist (list_t flist, struct mu_auth_data **return_data,
129 int rc = 1; 129 int rc = 1;
130 iterator_t itr; 130 iterator_t itr;
131 131
132 if (iterator_create (&itr, flist) == 0) 132 if (list_get_iterator (flist, &itr) == 0)
133 { 133 {
134 struct auth_stack_entry *ep; 134 struct auth_stack_entry *ep;
135 135
...@@ -330,7 +330,7 @@ _locate (const char *name) ...@@ -330,7 +330,7 @@ _locate (const char *name)
330 struct _module_handler *rp = NULL; 330 struct _module_handler *rp = NULL;
331 iterator_t itr; 331 iterator_t itr;
332 332
333 if (iterator_create (&itr, module_handler_list) == 0) 333 if (list_get_iterator (module_handler_list, &itr) == 0)
334 { 334 {
335 struct _module_handler *p; 335 struct _module_handler *p;
336 336
...@@ -431,7 +431,7 @@ mu_auth_begin_setup () ...@@ -431,7 +431,7 @@ mu_auth_begin_setup ()
431 431
432 if (!mu_authenticate_list) 432 if (!mu_authenticate_list)
433 { 433 {
434 if (iterator_create (&itr, module_handler_list) == 0) 434 if (list_get_iterator (module_handler_list, &itr) == 0)
435 { 435 {
436 struct _module_handler *mod; 436 struct _module_handler *mod;
437 437
...@@ -448,7 +448,7 @@ mu_auth_begin_setup () ...@@ -448,7 +448,7 @@ mu_auth_begin_setup ()
448 448
449 if (!mu_auth_by_name_list) 449 if (!mu_auth_by_name_list)
450 { 450 {
451 if (iterator_create (&itr, module_handler_list) == 0) 451 if (list_get_iterator (module_handler_list, &itr) == 0)
452 { 452 {
453 struct _module_handler *mod; 453 struct _module_handler *mod;
454 454
......
...@@ -265,7 +265,7 @@ mu_retrieve (list_t flist, void *data) ...@@ -265,7 +265,7 @@ mu_retrieve (list_t flist, void *data)
265 void *p = NULL; 265 void *p = NULL;
266 iterator_t itr; 266 iterator_t itr;
267 267
268 if (iterator_create (&itr, flist) == 0) 268 if (list_get_iterator (flist, &itr) == 0)
269 { 269 {
270 mu_retrieve_fp fun; 270 mu_retrieve_fp fun;
271 for (iterator_first (itr); !p && !iterator_is_done (itr); 271 for (iterator_first (itr); !p && !iterator_is_done (itr);
......
...@@ -134,7 +134,7 @@ observable_destroy (observable_t *pobservable, void *owner) ...@@ -134,7 +134,7 @@ observable_destroy (observable_t *pobservable, void *owner)
134 observable_t observable = *pobservable; 134 observable_t observable = *pobservable;
135 if (observable->owner == owner) 135 if (observable->owner == owner)
136 { 136 {
137 int status = iterator_create (&iterator, observable->list); 137 int status = list_get_iterator (observable->list, &iterator);
138 if (status == 0) 138 if (status == 0)
139 { 139 {
140 event_t event = NULL; 140 event_t event = NULL;
...@@ -185,9 +185,9 @@ observable_detach (observable_t observable, observer_t observer) ...@@ -185,9 +185,9 @@ observable_detach (observable_t observable, observer_t observer)
185 int status; 185 int status;
186 int found = 0; 186 int found = 0;
187 event_t event = NULL; 187 event_t event = NULL;
188 if (observable == NULL ||observer == NULL) 188 if (observable == NULL || observer == NULL)
189 return EINVAL; 189 return EINVAL;
190 status = iterator_create (&iterator, observable->list); 190 status = list_get_iterator (observable->list, &iterator);
191 if (status != 0) 191 if (status != 0)
192 return status; 192 return status;
193 for (iterator_first (iterator); !iterator_is_done (iterator); 193 for (iterator_first (iterator); !iterator_is_done (iterator);
...@@ -220,7 +220,7 @@ observable_notify (observable_t observable, int type) ...@@ -220,7 +220,7 @@ observable_notify (observable_t observable, int type)
220 int status = 0; 220 int status = 0;
221 if (observable == NULL) 221 if (observable == NULL)
222 return EINVAL; 222 return EINVAL;
223 status = iterator_create (&iterator, observable->list); 223 status = list_get_iterator (observable->list, &iterator);
224 if (status != 0) 224 if (status != 0)
225 return status; 225 return status;
226 for (iterator_first (iterator); !iterator_is_done (iterator); 226 for (iterator_first (iterator); !iterator_is_done (iterator);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2003 Free Software Foundation, Inc. 2 Copyright (C) 2003, 2004 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
...@@ -121,7 +121,7 @@ ali_print_name_list (list_t list, int off) ...@@ -121,7 +121,7 @@ ali_print_name_list (list_t list, int off)
121 iterator_t itr; 121 iterator_t itr;
122 char *item; 122 char *item;
123 123
124 iterator_create (&itr, list); 124 list_get_iterator (list, &itr);
125 125
126 if (list_mode) 126 if (list_mode)
127 { 127 {
......
1 %{ 1 %{
2 /* GNU Mailutils -- a suite of utilities for electronic mail 2 /* GNU Mailutils -- a suite of utilities for electronic mail
3 Copyright (C) 2003 Free Software Foundation, Inc. 3 Copyright (C) 2003, 2004 Free Software Foundation, Inc.
4 4
5 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
6 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
...@@ -61,7 +61,7 @@ ali_list_to_string (list_t *plist) ...@@ -61,7 +61,7 @@ ali_list_to_string (list_t *plist)
61 char *p; 61 char *p;
62 size_t length = 0; 62 size_t length = 0;
63 iterator_t itr; 63 iterator_t itr;
64 iterator_create (&itr, *plist); 64 list_get_iterator (*plist, &itr);
65 for (iterator_first (itr); !iterator_is_done (itr); iterator_next(itr)) 65 for (iterator_first (itr); !iterator_is_done (itr); iterator_next(itr))
66 { 66 {
67 char *s; 67 char *s;
...@@ -207,7 +207,7 @@ ali_list_dup (list_t src) ...@@ -207,7 +207,7 @@ ali_list_dup (list_t src)
207 if (list_create (&dst)) 207 if (list_create (&dst))
208 return NULL; 208 return NULL;
209 209
210 if (iterator_create (&itr, src)) 210 if (list_get_iterator (src, &itr))
211 { 211 {
212 list_destroy (&dst); 212 list_destroy (&dst);
213 return NULL; 213 return NULL;
...@@ -229,7 +229,7 @@ ali_member (list_t list, char *name) ...@@ -229,7 +229,7 @@ ali_member (list_t list, char *name)
229 iterator_t itr; 229 iterator_t itr;
230 int found = 0; 230 int found = 0;
231 231
232 if (iterator_create (&itr, list)) 232 if (list_get_iterator (list, &itr))
233 return 0; 233 return 0;
234 for (iterator_first (itr); !found && !iterator_is_done (itr); 234 for (iterator_first (itr); !found && !iterator_is_done (itr);
235 iterator_next (itr)) 235 iterator_next (itr))
...@@ -266,7 +266,7 @@ _insert_list (list_t list, void *prev, list_t new_list) ...@@ -266,7 +266,7 @@ _insert_list (list_t list, void *prev, list_t new_list)
266 { 266 {
267 iterator_t itr; 267 iterator_t itr;
268 268
269 if (iterator_create (&itr, new_list)) 269 if (list_get_iterator (new_list, &itr))
270 return 1; 270 return 1;
271 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 271 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
272 { 272 {
...@@ -288,7 +288,7 @@ alias_expand_list (list_t name_list, iterator_t orig_itr, int *inclusive) ...@@ -288,7 +288,7 @@ alias_expand_list (list_t name_list, iterator_t orig_itr, int *inclusive)
288 { 288 {
289 iterator_t itr; 289 iterator_t itr;
290 290
291 if (iterator_create (&itr, name_list)) 291 if (list_get_iterator (name_list, &itr))
292 return 1; 292 return 1;
293 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 293 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
294 { 294 {
...@@ -318,7 +318,7 @@ mh_alias_get_internal (char *name, iterator_t start, list_t *return_list, ...@@ -318,7 +318,7 @@ mh_alias_get_internal (char *name, iterator_t start, list_t *return_list,
318 318
319 if (!start) 319 if (!start)
320 { 320 {
321 if (iterator_create (&itr, alias_list)) 321 if (list_get_iterator (alias_list, &itr))
322 return 1; 322 return 1;
323 iterator_first (itr); 323 iterator_first (itr);
324 } 324 }
...@@ -368,7 +368,7 @@ mh_alias_get_address (char *name, address_t *paddr, int *incl) ...@@ -368,7 +368,7 @@ mh_alias_get_address (char *name, address_t *paddr, int *incl)
368 return 1; 368 return 1;
369 } 369 }
370 370
371 if (iterator_create (&itr, list) == 0) 371 if (list_get_iterator (list, &itr) == 0)
372 { 372 {
373 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 373 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
374 { 374 {
...@@ -416,7 +416,7 @@ mh_alias_get_alias (char *uname, list_t *return_list) ...@@ -416,7 +416,7 @@ mh_alias_get_alias (char *uname, list_t *return_list)
416 iterator_t itr; 416 iterator_t itr;
417 int rc = 1; 417 int rc = 1;
418 418
419 if (iterator_create (&itr, alias_list)) 419 if (list_get_iterator (alias_list, &itr))
420 return 1; 420 return 1;
421 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 421 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
422 { 422 {
...@@ -441,7 +441,7 @@ mh_alias_enumerate (mh_alias_enumerator_t fun, void *data) ...@@ -441,7 +441,7 @@ mh_alias_enumerate (mh_alias_enumerator_t fun, void *data)
441 iterator_t itr; 441 iterator_t itr;
442 int rc = 0; 442 int rc = 0;
443 443
444 if (iterator_create (&itr, alias_list)) 444 if (list_get_iterator (alias_list, &itr))
445 return ; 445 return ;
446 for (iterator_first (itr); 446 for (iterator_first (itr);
447 rc == 0 && !iterator_is_done (itr); 447 rc == 0 && !iterator_is_done (itr);
......
1 %{ 1 %{
2 /* GNU Mailutils -- a suite of utilities for electronic mail 2 /* GNU Mailutils -- a suite of utilities for electronic mail
3 Copyright (C) 2003 Free Software Foundation, Inc. 3 Copyright (C) 2003, 2004 Free Software Foundation, Inc.
4 4
5 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
6 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
...@@ -261,7 +261,7 @@ pick_parse (list_t toklist) ...@@ -261,7 +261,7 @@ pick_parse (list_t toklist)
261 return 0; 261 return 0;
262 } 262 }
263 263
264 if (iterator_create (&iterator, toklist)) 264 if (list_get_iterator (toklist, &iterator))
265 return -1; 265 return -1;
266 iterator_first (iterator); 266 iterator_first (iterator);
267 rc = yyparse (); 267 rc = yyparse ();
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2002,2003 Free Software Foundation, Inc. 2 Copyright (C) 2002,2003,2004 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,7 +96,7 @@ open_folders () ...@@ -96,7 +96,7 @@ open_folders ()
96 exit (1); 96 exit (1);
97 } 97 }
98 98
99 if (iterator_create (&itr, folder_name_list)) 99 if (list_get_iterator (folder_name_list, &itr))
100 { 100 {
101 mh_error (_("can't create iterator")); 101 mh_error (_("can't create iterator"));
102 exit (1); 102 exit (1);
...@@ -121,7 +121,7 @@ enumerate_folders (void (*f) __P((void *, mailbox_t)), void *data) ...@@ -121,7 +121,7 @@ enumerate_folders (void (*f) __P((void *, mailbox_t)), void *data)
121 { 121 {
122 iterator_t itr; 122 iterator_t itr;
123 123
124 if (iterator_create (&itr, folder_mbox_list)) 124 if (list_get_iterator (folder_mbox_list, &itr))
125 { 125 {
126 mh_error (_("can't create iterator")); 126 mh_error (_("can't create iterator"));
127 exit (1); 127 exit (1);
......