commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-452-g530953e


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-452-g530953e
Date: Sat, 19 Nov 2011 14:36:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=530953e151f011eb2f57918039c402f475431a09

The branch, master has been updated
       via  530953e151f011eb2f57918039c402f475431a09 (commit)
      from  c96bc2c092dda2d3c9fe3f1498857c7d4afb56dc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 530953e151f011eb2f57918039c402f475431a09
Author: Sergey Poznyakoff <address@hidden>
Date:   Sat Nov 19 16:08:48 2011 +0200

    Rename mu_list_do to mu_list_foreach.  Add comments to mailutils/list.h

-----------------------------------------------------------------------

Summary of changes:
 imap4d/authenticate.c                 |    4 +-
 imap4d/capability.c                   |    2 +-
 imap4d/fetch.c                        |    4 +-
 imap4d/namespace.c                    |    6 +-
 imap4d/util.c                         |    2 +-
 include/mailutils/list.h              |  242 ++++++++++++++++++++++++---------
 libmailutils/auth/auth.c              |    2 +-
 libmailutils/cfg/driver.c             |    4 +-
 libmailutils/cfg/format.c             |    4 +-
 libmailutils/cfg/gocs.c               |    2 +-
 libmailutils/cfg/parser.y             |    8 +-
 libmailutils/list/Makefile.am         |    2 +-
 libmailutils/list/{do.c => foreach.c} |   10 ++-
 libmailutils/server/acl.c             |    2 +-
 libmailutils/server/msrv.c            |    4 +-
 libmu_cpp/list.cc                     |    2 +-
 libmu_sieve/comparator.c              |    4 +-
 libmu_sieve/conf.c                    |    6 +-
 libmu_sieve/load.c                    |    4 +-
 libmu_sieve/prog.c                    |    4 +-
 libmu_sieve/sieve.l                   |    2 +-
 libmu_sieve/sieve.y                   |    2 +-
 libmu_sieve/tests.c                   |    2 +-
 libmu_sieve/util.c                    |   12 +-
 libproto/imap/id.c                    |    2 +-
 libproto/imap/select.c                |    6 +-
 libproto/mailer/smtp_mech.c           |    4 +-
 maidag/lmtp.c                         |   10 +-
 maidag/script.c                       |    2 +-
 mail/send.c                           |    6 +-
 mail/util.c                           |    2 +-
 mh/mark.c                             |    6 +-
 mh/mh_format.c                        |    4 +-
 mh/mh_list.c                          |    8 +-
 mh/mh_whatnow.c                       |    2 +-
 mh/mh_whom.c                          |    6 +-
 mh/pick.c                             |    2 +-
 mh/send.c                             |    2 +-
 mh/sortm.c                            |    4 +-
 mimeview/mimetypes.y                  |    2 +-
 mu/dbm.c                              |    2 +-
 mu/filter.c                           |    2 +-
 sql/odbc.c                            |    2 +-
 testsuite/smtpsend.c                  |    2 +-
 44 files changed, 264 insertions(+), 148 deletions(-)
 rename libmailutils/list/{do.c => foreach.c} (84%)

diff --git a/imap4d/authenticate.c b/imap4d/authenticate.c
index 9f2c40a..3b6e258 100644
--- a/imap4d/authenticate.c
+++ b/imap4d/authenticate.c
@@ -83,7 +83,7 @@ _auth_try (void *item, void *data)
 void
 imap4d_auth_capability ()
 {
-  mu_list_do (imap_auth_list, _auth_capa, NULL);
+  mu_list_foreach (imap_auth_list, _auth_capa, NULL);
 }
 
 /*
@@ -112,7 +112,7 @@ imap4d_authenticate (struct imap4d_command *command, 
imap4d_tokbuf_t tok)
   adata.auth_type = auth_type;
   adata.username = NULL;
 
-  res = mu_list_do (imap_auth_list, _auth_try, &adata);
+  res = mu_list_foreach (imap_auth_list, _auth_try, &adata);
 
   switch (res)
     {
diff --git a/imap4d/capability.c b/imap4d/capability.c
index 9f1d4fc..71e59fc 100644
--- a/imap4d/capability.c
+++ b/imap4d/capability.c
@@ -75,7 +75,7 @@ imap4d_capability (struct imap4d_command *command, 
imap4d_tokbuf_t tok)
   
   io_sendf ("* CAPABILITY");
 
-  mu_list_do (capa_list, print_capa, NULL);
+  mu_list_foreach (capa_list, print_capa, NULL);
   
   imap4d_auth_capability ();
   io_sendf ("\n");
diff --git a/imap4d/fetch.c b/imap4d/fetch.c
index 077e38b..aee0a6f 100644
--- a/imap4d/fetch.c
+++ b/imap4d/fetch.c
@@ -1057,7 +1057,7 @@ _frt_header_fields (struct fetch_function_closure *ffc,
     io_sendf (".NOT");
   io_sendf (" (");
   status = 0;
-  mu_list_do (ffc->headers, _send_header_name, &status);
+  mu_list_foreach (ffc->headers, _send_header_name, &status);
   io_sendf (")]");
   
   msg = fetch_get_part (ffc, frt);
@@ -1683,7 +1683,7 @@ imap4d_fetch0 (imap4d_tokbuf_t tok, int isuid, char 
**err_text)
            {
              io_sendf ("* %lu FETCH (", (unsigned long) frc.msgno);
              frc.eltno = 0;
-             rc = mu_list_do (pclos.fnlist, _do_fetch, &frc);
+             rc = mu_list_foreach (pclos.fnlist, _do_fetch, &frc);
              io_sendf (")\n");
            }
        }
diff --git a/imap4d/namespace.c b/imap4d/namespace.c
index 9f85fd3..bee550a 100644
--- a/imap4d/namespace.c
+++ b/imap4d/namespace.c
@@ -56,7 +56,7 @@ print_namespace (int nsid)
       int count;
       count = 0;
       io_sendf ("(");
-      mu_list_do (list, print_namespace_fun, &count);
+      mu_list_foreach (list, print_namespace_fun, &count);
       io_sendf (")");
     }
 }
@@ -84,7 +84,7 @@ namespace_enumerate (int id, nsfp_t f, void *closure)
   nsc.fun = f;
   nsc.closure = closure;
   return namespace[id] == 0 ? 0 :
-          mu_list_do (namespace[id], _enum_fun, &nsc);
+          mu_list_foreach (namespace[id], _enum_fun, &nsc);
 }
 
 static int
@@ -271,7 +271,7 @@ namespace_init ()
          mu_list_t list;
          mu_list_create (&list);
          mu_list_set_destroy_item (list, mu_list_free_item);
-         mu_list_do (namespace[i], normalize_fun, list);
+         mu_list_foreach (namespace[i], normalize_fun, list);
          mu_list_set_destroy_item (namespace[i], mu_list_free_item);
          mu_list_destroy (&namespace[i]);
          namespace[i] = list;
diff --git a/imap4d/util.c b/imap4d/util.c
index 2b546f0..4e960b2 100644
--- a/imap4d/util.c
+++ b/imap4d/util.c
@@ -659,7 +659,7 @@ util_bye ()
 {
   mu_stream_close (iostream);
   mu_stream_destroy (&iostream);
-  mu_list_do (atexit_list, atexit_run, 0);
+  mu_list_foreach (atexit_list, atexit_run, 0);
 }
 
 void
diff --git a/include/mailutils/list.h b/include/mailutils/list.h
index becf280..296b6ec 100644
--- a/include/mailutils/list.h
+++ b/include/mailutils/list.h
@@ -25,72 +25,180 @@
 extern "C" {
 #endif
 
-extern int mu_list_create   (mu_list_t *);
-extern void mu_list_destroy (mu_list_t *);
-extern void mu_list_clear (mu_list_t list);
-extern int mu_list_append   (mu_list_t, void *item);
-extern int mu_list_prepend  (mu_list_t, void *item);
-extern int mu_list_insert   (mu_list_t list, void *item, void *new_item, 
-                          int insert_before);
-extern int mu_list_is_empty (mu_list_t);
-extern int mu_list_count    (mu_list_t, size_t *pcount);
-extern int mu_list_remove   (mu_list_t, void *item);
-extern int mu_list_remove_nd  (mu_list_t, void *item);
-extern int mu_list_replace  (mu_list_t list, void *old_item, void *new_item);  
-extern int mu_list_replace_nd (mu_list_t list, void *old_item, void 
*new_item);  
-extern int mu_list_get      (mu_list_t, size_t _index, void **pitem);
-extern int mu_list_to_array (mu_list_t list, void **array, size_t count, 
size_t *pcount);
-extern int mu_list_locate   (mu_list_t list, void *item, void **ret_item);
-extern int mu_list_get_iterator (mu_list_t, mu_iterator_t *);
-
-typedef int mu_list_action_t (void *item, void *cbdata);
-
-extern int mu_list_do       (mu_list_t list, mu_list_action_t *action, void 
*cbdata);
-
-typedef int (*mu_list_comparator_t) (const void*, const void*);
-
-extern int _mu_list_ptr_comparator (const void*, const void*);
+  /* ************************************************* */
+  /* List creation and destruction                     */
+  /* ************************************************* */
+int mu_list_create (mu_list_t *_plist);
+void mu_list_destroy (mu_list_t *_plist);
+  /* Remove all elements from the list, reclaiming the associated memory
+     if necessary (see mu_list_set_destroy_item), but don't destroy the
+     list itself. */
+void mu_list_clear (mu_list_t _list);
+
+  /* ************************************************* */
+  /* List Comparators                                  */
+  /* ************************************************* */
   
-extern mu_list_comparator_t mu_list_set_comparator (mu_list_t,
-                                                   mu_list_comparator_t);
-extern int mu_list_get_comparator (mu_list_t, mu_list_comparator_t *);
-
-extern void mu_list_free_item (void *item);
+  /* A comparator is associated with each list, which is used to compare
+     two elements for equality.  The comparator is a function of
+     mu_list_comparator_t type, which returns 0 if its arguments are equal
+     and non-zero otherwise: */
+typedef int (*mu_list_comparator_t) (const void*, const void*);
+  /* The default comparator function compares two pointers for equality. */
+int _mu_list_ptr_comparator (const void*, const void*);
+  /* Set _cmp as a new comparator function for _list.  Return old
+     comparator. */
+mu_list_comparator_t mu_list_set_comparator (mu_list_t _list,
+                                            mu_list_comparator_t _cmp);
+  /* Returns in _pcmp a pointer to the comparator function of _list: */
+int mu_list_get_comparator (mu_list_t _list, mu_list_comparator_t *_pcmp);
+
+  /* ************************************************* */
+  /* Memory management                                 */
+  /* ************************************************* */
 
+  /* The destroy function is responsible for deallocating a list element.
+     By default, it is not set. */
 typedef void (*mu_list_destroy_item_t) (void *);
-  
-extern mu_list_destroy_item_t mu_list_set_destroy_item
-              (mu_list_t list, mu_list_destroy_item_t destroy_item);
 
+  /* An often used destroy function.  It simply calls free(3) over the
+     _item. */
+void mu_list_free_item (void *_item);
 
-extern int mu_list_intersect_dup (mu_list_t *, mu_list_t, mu_list_t,
-                                 int (*dup_item) (void **, void *, void *),
-                                 void *);
-extern int mu_list_intersect (mu_list_t *, mu_list_t, mu_list_t);  
-
-extern int mu_list_insert_list (mu_list_t list, void *item, mu_list_t new_list,
-                               int insert_before);
-extern void mu_list_append_list (mu_list_t list, mu_list_t new_list);
-extern void mu_list_prepend_list (mu_list_t list, mu_list_t new_list);
+  /* Sets the destroy function for _list and returns old destroy
+     function: */
+mu_list_destroy_item_t mu_list_set_destroy_item (mu_list_t _list,
+                          mu_list_destroy_item_t _destroy_item);
+
+  /* ************************************************* */
+  /* List informational functions:                     */
+  /* ************************************************* */
+
+  /* Return true if _list has no items. */
+int mu_list_is_empty (mu_list_t _list);
+  /* Write the number of items currently in _list to the memory location
+     pointed to by _pcount. */
+int mu_list_count    (mu_list_t _list, size_t *_pcount);
 
-/* List mapper functions */
-typedef int (*mu_list_mapper_t) (void **itmv, size_t itmc, void *call_data);
+  /* ************************************************* */
+  /* Functions for retrieving list elements:           */
+  /* ************************************************* */
+  
+  /* Get _indexth element from the list and store it in _pitem. */
+int mu_list_get      (mu_list_t _list, size_t _index, void **_pitem);
+  /* Store at most _count first elements from _list in the _array.  Unless
+     _pcount is NULL, fill it with the actual number of elements copied. */
+int mu_list_to_array (mu_list_t _list, void **_array, size_t _count,
+                     size_t *_pcount);
+  /* Look for the element matching _item (in the sense of the item comparator
+     method, see mu_list_set_comparator) and return it in the memory location
+     pointed to by _ret_item. */
+int mu_list_locate   (mu_list_t list, void *item, void **ret_item);
+  
+  /* ************************************************* */
+  /* Functions for adding and removing elements:       */
+  /* ************************************************* */
+  
+  /* Add _item to the tail of the _list. */
+int mu_list_append   (mu_list_t _list, void *_item);
+  /* Add _item to the head of the _list */
+int mu_list_prepend  (mu_list_t _list, void *_item);
+  /* Insert _item after _new_item in _list (or before it, if _insert_before
+     is 1. */
+int mu_list_insert   (mu_list_t _list, void *_item, void *_new_item, 
+                      int _insert_before);
+  /* Remove _item from _list and deallocate any memory associated with it
+     using the `destroy_item' method. */
+int mu_list_remove   (mu_list_t _list, void *_item);
+  /* A non-destructive version of mu_list_remove: removes the _item but does
+     not deallocate it. */
+int mu_list_remove_nd  (mu_list_t _list, void *_item);
+  /* Find _old_item in _list and if found, replace it with _new_item,
+     deallocating the removed item via the `destroy_item' method. */
+int mu_list_replace  (mu_list_t _list, void *_old_item, void *_new_item);
+  /* A non-destructive version of mu_list_replace: the removed item is not
+     deallocated. */
+int mu_list_replace_nd (mu_list_t _list, void *_old_item, void *_new_item);
+
+  /* ************************************************* */
+  /* Interation over lists.                            */
+  /* ************************************************* */
+
+  /* Get iterator for this _list and return it in _pitr, if successful. */
+int mu_list_get_iterator (mu_list_t _list, mu_iterator_t *_pitr);
+
+  /* A general-purpose iteration function.  When called, _item points to
+     the item currently visited and _data points to call-specific data. */
+typedef int mu_list_action_t (void *_item, void *_data);
+
+  /* Execute _action for each element in _list.  Use _data as the call-specific
+     data. */
+int mu_list_foreach (mu_list_t _list, mu_list_action_t *_action, void *_data);
+  /* A historical alias to the above. */
+int mu_list_do (mu_list_t, mu_list_action_t *, void *) MU_DEPRECATED;
+
+  /* ************************************************* */
+  /* Functions for combining two lists.                */
+  /* ************************************************* */
+
+  /* Move elements from _new_list to _list, adding them to the tail of
+     the latter. */
+void mu_list_append_list (mu_list_t _list, mu_list_t _new_list);
+  /* Move elements from _new_list to _list, adding them to the head of
+     the latter. */
+void mu_list_prepend_list (mu_list_t _list, mu_list_t _new_list);
+
+  /* Move data from _new_list to _list, inserting them after the
+     element matching _anchor (in the sense of _list's comparator
+     function).  If _insert_before is 1, items are inserted before
+     _achor instead. */
+int mu_list_insert_list (mu_list_t _list, void *_anchor,
+                        mu_list_t _new_list,
+                        int _insert_before);
+
+  /* Compute an intersection of two lists (_list1 and _list2) and return
+     it in _pdest.  The resulting list contains elements from _list1 that
+     are also encountered in _list2 (as per comparison function of
+     the latter).
+     
+     If _dup_item is not NULL, it is called to create copies of
+     items to be stored in _pdest.  In this case, the destroy_item
+     function of _list2 is also attached to _pdest.
+
+     The _dup_item parameters are: a pointer for returned data, the
+     original item and call-specific data.  The _dup_data 
+     argument is passed as the 3rd argument in each call to _dup_item.
+     
+     If _dup_item is NULL, pointers to elements are stored and
+     no destroy_item function is assigned. */
+int mu_list_intersect_dup (mu_list_t *_pdest,
+                          mu_list_t _list1, mu_list_t _list2,
+                          int (*_dup_item) (void **, void *, void *),
+                          void *_dup_data);
+  
+  /* Same as mu_list_intersect_dup with _dup_item = NULL */
+int mu_list_intersect (mu_list_t *, mu_list_t, mu_list_t);  
+
+  /* ************************************************* */
+  /* List mapper functions                             */
+  /* ************************************************* */
+  
+typedef int (*mu_list_mapper_t) (void **_itmv, size_t _itmc, void *_call_data);
 
 /* A generalized list mapping function.
 
-   Mu_list_gmap iterates over the LIST, gathering its elements in an
-   array of type void **.  When NELEM elements has been collected, it
-   calls the MAP function, passing it as arguments the constructed array,
-   number of elements in it (can be less than NELEM on the last call),
-   and call-specific DATA.  Iteration continues while MAP returns 0 and
-   until all elements from the array have been visited.
+   Mu_list_gmap iterates over the _list, gathering its elements in an
+   array of type void **.  Each time _nelem elements has been collected,
+   it calls the _map function, passing it as arguments the constructed array,
+   the number of elements in it (which can be less than _nelem on the last
+   call), and call-specific _data.  Iteration continues while _map returns 0
+   and until all elements from the array have been visited.
 
    Mu_list_gmap returns 0 on success and a non-zero error code on failure.
-   If MAP returns !0, its return value is propagated to the caller.
-*/
+   If _map returns non-zero, its return value is propagated to the caller. */
    
-int mu_list_gmap (mu_list_t list, mu_list_mapper_t map, size_t nelem,
-                 void *data);
+int mu_list_gmap (mu_list_t _list, mu_list_mapper_t _map, size_t _nelem,
+                 void *_data);
   
   
 #define MU_LIST_MAP_OK     0x00
@@ -99,24 +207,24 @@ int mu_list_gmap (mu_list_t list, mu_list_mapper_t map, 
size_t nelem,
 
 /* List-to-list mapping.
    
-   Apply the list mapping function MAP to each NELEM elements from the source
-   LIST and use its return values to form a new list, which will be returned
-   in RES.
+   Apply the list mapping function _map to each _nelem elements from the source
+   _list and use its return values to form a new list, which will be returned
+   in _res.
 
-   MAP gets pointers to the collected elements in its first argument (ITMV).
-   Its second argument (ITMC) gives the number of elements filled in ARR.
-   It can be less than NELEM on the last call to MAP.  The DATA pointer is
-   passed as the 3rd argument.
+   The _map function gets pointers to the collected elements in its first
+   argument (_itmv).  Its second argument (_itmc) keeps the number of elements
+   filled in there.  It can be less than _nelem on the last call to _map.
+   The _data pointer is passed as the 3rd argument.
 
-   Return value from MAP governs the mapping process.  Unless it has the
-   MU_LIST_MAP_SKIP bit set, the itmv[0] element is appended to the new
+   The return value from _map governs the mapping process.  Unless it has the
+   MU_LIST_MAP_SKIP bit set, the _itmv[0] element is appended to the new
    list.  If it has MU_LIST_MAP_STOP bit set, iteration is stopped
-   immediately and any remaining elements in LIST are ignored.
+   immediately and any remaining elements in _list are ignored.
 */
 
-int mu_list_map (mu_list_t list, mu_list_mapper_t map,
-                void *data, size_t nelem,
-                mu_list_t *res);
+int mu_list_map (mu_list_t _list, mu_list_mapper_t _map,
+                void *_data, size_t _nelem,
+                mu_list_t *_res);
 #ifdef __cplusplus
 }
 #endif
diff --git a/libmailutils/auth/auth.c b/libmailutils/auth/auth.c
index 502c9af..b72d918 100644
--- a/libmailutils/auth/auth.c
+++ b/libmailutils/auth/auth.c
@@ -136,7 +136,7 @@ mu_authority_authenticate (mu_authority_t authority)
       struct auth_cb cb;
       cb.status = MU_ERR_AUTH_FAILURE;
       cb.authority = authority;
-      mu_list_do (authority->auth_methods, try_auth, &cb);
+      mu_list_foreach (authority->auth_methods, try_auth, &cb);
       return cb.status;
     }
   return EINVAL;
diff --git a/libmailutils/cfg/driver.c b/libmailutils/cfg/driver.c
index 8db81a2..47ca794 100644
--- a/libmailutils/cfg/driver.c
+++ b/libmailutils/cfg/driver.c
@@ -169,7 +169,7 @@ dup_container (struct mu_cfg_cont **pcont)
       newcont->v.section.offset = oldcont->v.section.offset;
       newcont->v.section.docstring = oldcont->v.section.docstring;
       newcont->v.section.children = NULL;
-      mu_list_do (oldcont->v.section.children, _dup_cont_action, &dd);
+      mu_list_foreach (oldcont->v.section.children, _dup_cont_action, &dd);
       break;
 
     case mu_cfg_cont_param:
@@ -329,7 +329,7 @@ mu_config_clone_container (struct mu_cfg_cont *cont)
   switch (cont->type)
     {
     case mu_cfg_cont_section:
-      mu_list_do (cont->v.section.children, _clone_action, NULL);
+      mu_list_foreach (cont->v.section.children, _clone_action, NULL);
       break;
 
     case mu_cfg_cont_param:
diff --git a/libmailutils/cfg/format.c b/libmailutils/cfg/format.c
index 2faee80..c1bc377 100644
--- a/libmailutils/cfg/format.c
+++ b/libmailutils/cfg/format.c
@@ -401,7 +401,7 @@ format_section (mu_stream_t stream, struct mu_cfg_section 
*sect, int level)
       mu_stream_write (stream, " {\n", 3, NULL);
       c.stream = stream;
       c.level = level + 1; 
-      mu_list_do (sect->children, _f_helper, &c);
+      mu_list_foreach (sect->children, _f_helper, &c);
       format_level (stream, level);
       mu_stream_write (stream, "};\n\n", 4, NULL);
     }
@@ -409,7 +409,7 @@ format_section (mu_stream_t stream, struct mu_cfg_section 
*sect, int level)
     {
       c.stream = stream;
       c.level = level; 
-      mu_list_do (sect->children, _f_helper, &c);
+      mu_list_foreach (sect->children, _f_helper, &c);
     }
 }
 
diff --git a/libmailutils/cfg/gocs.c b/libmailutils/cfg/gocs.c
index ba376b3..e8ed629 100644
--- a/libmailutils/cfg/gocs.c
+++ b/libmailutils/cfg/gocs.c
@@ -376,7 +376,7 @@ void
 mu_gocs_flush ()
 {
   int i;
-  mu_list_do (data_list, _gocs_flush, NULL);
+  mu_list_foreach (data_list, _gocs_flush, NULL);
 
   for (i = 0; _gocs_table[i].name; i++)
     _gocs_table[i].init (mu_gocs_op_flush, NULL);
diff --git a/libmailutils/cfg/parser.y b/libmailutils/cfg/parser.y
index 9a64bfb..2ee1057 100644
--- a/libmailutils/cfg/parser.y
+++ b/libmailutils/cfg/parser.y
@@ -234,7 +234,7 @@ block   : ident tag '{' '}' opt_sc
          {
            $$ = mu_cfg_alloc_node (mu_cfg_node_statement, &$1.locus,
                                    $1.name, $2, $4);
-           mu_list_do ($4, _node_set_parent, $$);
+           mu_list_foreach ($4, _node_set_parent, $$);
          }
        ;
 
@@ -568,7 +568,7 @@ mu_cfg_tree_postprocess (mu_cfg_tree_t *tree,
                      && strcmp (node->label->v.string, hints->program) == 0)
                    {
                      /* Reset the parent node */
-                     mu_list_do (node->nodes, _node_set_parent,
+                     mu_list_foreach (node->nodes, _node_set_parent,
                                  node->parent);
                      /* Move all nodes from this block to the topmost
                         level */
@@ -656,7 +656,7 @@ _mu_cfg_preorder_recursive (void *item, void *cbdata)
 int
 mu_cfg_preorder (mu_list_t nodelist, struct mu_cfg_iter_closure *clos)
 {
-  return mu_list_do (nodelist, _mu_cfg_preorder_recursive, clos);
+  return mu_list_foreach (nodelist, _mu_cfg_preorder_recursive, clos);
 }
 
 
@@ -1254,7 +1254,7 @@ parse_param (struct scan_tree_data *sdata, const 
mu_cfg_node_t *node)
        }
       
       mu_list_create (&clos.list);
-      mu_list_do (node->label->v.list, _set_fun, &clos);
+      mu_list_foreach (node->label->v.list, _set_fun, &clos);
       *(mu_list_t*)tgt = clos.list;
     }
   else if (clos.type == mu_cfg_callback)
diff --git a/libmailutils/list/Makefile.am b/libmailutils/list/Makefile.am
index 3b959fc..0ed2480 100644
--- a/libmailutils/list/Makefile.am
+++ b/libmailutils/list/Makefile.am
@@ -24,8 +24,8 @@ liblist_la_SOURCES = \
  count.c\
  create.c\
  destroy.c\
- do.c\
  empty.c\
+ foreach.c\
  get.c\
  getcomp.c\
  gmap.c\
diff --git a/libmailutils/list/do.c b/libmailutils/list/foreach.c
similarity index 84%
rename from libmailutils/list/do.c
rename to libmailutils/list/foreach.c
index ef9ef17..131f587 100644
--- a/libmailutils/list/do.c
+++ b/libmailutils/list/foreach.c
@@ -24,7 +24,7 @@
 #include <mailutils/errno.h>
 
 int
-mu_list_do (mu_list_t list, mu_list_action_t *action, void *cbdata)
+mu_list_foreach (mu_list_t list, mu_list_action_t *action, void *cbdata)
 {
   mu_iterator_t itr;
   int status = 0;
@@ -45,3 +45,11 @@ mu_list_do (mu_list_t list, mu_list_action_t *action, void 
*cbdata)
   mu_iterator_destroy (&itr);
   return status;
 }
+
+/* Retained for compatibility with previous versions.
+   In the future it will be removed, or changed to a define or weak alias. */
+int
+mu_list_do (mu_list_t list, mu_list_action_t *action, void *cbdata)
+{
+  return mu_list_foreach (list, action, cbdata);
+}
diff --git a/libmailutils/server/acl.c b/libmailutils/server/acl.c
index ba1a4b8..8228b0e 100644
--- a/libmailutils/server/acl.c
+++ b/libmailutils/server/acl.c
@@ -556,7 +556,7 @@ mu_acl_check_sockaddr (mu_acl_t acl, const struct sockaddr 
*sa, int salen,
   r.result = pres;
   *r.result = mu_acl_result_undefined;
   r.numbuf = NULL;
-  mu_list_do (acl->aclist, _run_entry, &r);
+  mu_list_foreach (acl->aclist, _run_entry, &r);
   free (r.numbuf);
   free (r.addrstr);
   return 0;
diff --git a/libmailutils/server/msrv.c b/libmailutils/server/msrv.c
index fca9322..19bb201 100644
--- a/libmailutils/server/msrv.c
+++ b/libmailutils/server/msrv.c
@@ -229,7 +229,7 @@ mu_m_server_idle (void *server_data MU_ARG_UNUSED)
       need_cleanup = 0;
       while ( (ex.pid = waitpid (-1, &ex.status, WNOHANG)) > 0)
        /* Iterate over all m-servers and notify them about the fact. */
-       mu_list_do (m_server_list, m_server_cleanup, &ex);
+       mu_list_foreach (m_server_list, m_server_cleanup, &ex);
     }
   return stop;
 }
@@ -619,7 +619,7 @@ mu_m_server_run (mu_m_server_t msrv)
   int rc;
   size_t count;
   mode_t saved_umask = umask (0117);
-  mu_list_do (msrv->srvlist, _open_conn, msrv);
+  mu_list_foreach (msrv->srvlist, _open_conn, msrv);
   umask (saved_umask);
   mu_list_destroy (&msrv->srvlist);
   MU_ASSERT (mu_server_count (msrv->server, &count));
diff --git a/libmu_cpp/list.cc b/libmu_cpp/list.cc
index 822bb85..8272d96 100644
--- a/libmu_cpp/list.cc
+++ b/libmu_cpp/list.cc
@@ -201,7 +201,7 @@ List :: size ()
 void
 List :: apply (mu_list_action_t* action, void* cbdata)
 {
-  int status = mu_list_do (mu_list, action, cbdata);
+  int status = mu_list_foreach (mu_list, action, cbdata);
   if (status)
     throw Exception ("List::apply", status);
 }
diff --git a/libmu_sieve/comparator.c b/libmu_sieve/comparator.c
index 7d8856d..346a168 100644
--- a/libmu_sieve/comparator.c
+++ b/libmu_sieve/comparator.c
@@ -131,7 +131,7 @@ mu_sieve_get_comparator (mu_sieve_machine_t mach, mu_list_t 
tags)
 {
   mu_sieve_comparator_t comp = NULL;
 
-  mu_list_do (tags, _find_comparator, &comp);
+  mu_list_foreach (tags, _find_comparator, &comp);
   return comp ? comp : mu_sieve_comparator_lookup (mach,
                                                "i;ascii-casemap",
                                                MU_SIEVE_MATCH_IS);
@@ -192,7 +192,7 @@ static void
 _free_reglist (void *data)
 {
   mu_list_t list = data;
-  mu_list_do (list, _free_regex, NULL);
+  mu_list_foreach (list, _free_regex, NULL);
   mu_list_destroy (&list);
 }
 
diff --git a/libmu_sieve/conf.c b/libmu_sieve/conf.c
index a76134b..7ef2c15 100644
--- a/libmu_sieve/conf.c
+++ b/libmu_sieve/conf.c
@@ -62,15 +62,15 @@ mu_sieve_module_init (enum mu_gocs_op op, void *data)
 
   if (p->clearflags & MU_SIEVE_CLEAR_INCLUDE_PATH)
     mu_list_destroy (&mu_sieve_include_path);
-  mu_list_do (p->include_path, _path_append, &mu_sieve_include_path);
+  mu_list_foreach (p->include_path, _path_append, &mu_sieve_include_path);
   if (p->clearflags & MU_SIEVE_CLEAR_LIBRARY_PATH)
     {
       mu_list_destroy (&mu_sieve_library_path);
       mu_list_destroy (&mu_sieve_library_path_prefix);
     }
-  mu_list_do (p->library_path_prefix, _path_append,
+  mu_list_foreach (p->library_path_prefix, _path_append,
              &mu_sieve_library_path_prefix);
-  mu_list_do (p->library_path, _path_append, &mu_sieve_library_path);
+  mu_list_foreach (p->library_path, _path_append, &mu_sieve_library_path);
   mu_list_destroy (&p->library_path);
   mu_list_destroy (&p->library_path_prefix);
   mu_list_destroy (&p->include_path);
diff --git a/libmu_sieve/load.c b/libmu_sieve/load.c
index d10a198..7d91405 100644
--- a/libmu_sieve/load.c
+++ b/libmu_sieve/load.c
@@ -52,11 +52,11 @@ sieve_init_load_path ()
     {
       if (lt_dlinit ())
        return 1;
-      mu_list_do (mu_sieve_library_path_prefix, _add_load_dir, NULL);
+      mu_list_foreach (mu_sieve_library_path_prefix, _add_load_dir, NULL);
 #ifdef MU_SIEVE_MODDIR
       _add_load_dir (MU_SIEVE_MODDIR, NULL);
 #endif
-      mu_list_do (mu_sieve_library_path, _add_load_dir, NULL);
+      mu_list_foreach (mu_sieve_library_path, _add_load_dir, NULL);
       inited = 1;
     }
   return 0;
diff --git a/libmu_sieve/prog.c b/libmu_sieve/prog.c
index 13e8290..d24cbe1 100644
--- a/libmu_sieve/prog.c
+++ b/libmu_sieve/prog.c
@@ -234,7 +234,7 @@ mu_sv_code_command (mu_sieve_register_t *reg, mu_list_t 
arglist)
                      err = 1;
                      break;
                    }
-                 if (mu_list_do (chk_list, _compare_ptr, cf) == 0)
+                 if (mu_list_foreach (chk_list, _compare_ptr, cf) == 0)
                    mu_list_append (chk_list, cf);
                }
            }
@@ -307,7 +307,7 @@ mu_sv_code_command (mu_sieve_register_t *reg, mu_list_t 
arglist)
          chk_arg.name = reg->name;
          chk_arg.tags = tag_list;
          chk_arg.args = arg_list;
-         err = mu_list_do (chk_list, _run_checker, &chk_arg);
+         err = mu_list_foreach (chk_list, _run_checker, &chk_arg);
        }
     }
   
diff --git a/libmu_sieve/sieve.l b/libmu_sieve/sieve.l
index 8abd121..5677ec7 100644
--- a/libmu_sieve/sieve.l
+++ b/libmu_sieve/sieve.l
@@ -382,7 +382,7 @@ sieve_include ()
     {
       char *p = name;
       if (mu_sieve_include_path
-         && mu_list_do (mu_sieve_include_path, _try_include, &p))
+         && mu_list_foreach (mu_sieve_include_path, _try_include, &p))
        {
          push_source (p);
          free (name);
diff --git a/libmu_sieve/sieve.y b/libmu_sieve/sieve.y
index 9abe35a..e5218fb 100644
--- a/libmu_sieve/sieve.y
+++ b/libmu_sieve/sieve.y
@@ -565,7 +565,7 @@ mu_sieve_machine_destroy (mu_sieve_machine_t *pmach)
                    MU_IOCTL_LOGSTREAM_SET_LOCUS, NULL);
   mu_stream_destroy (&mach->errstream);
   mu_mailer_destroy (&mach->mailer);
-  mu_list_do (mach->destr_list, _run_destructor, NULL);
+  mu_list_foreach (mach->destr_list, _run_destructor, NULL);
   mu_list_destroy (&mach->destr_list);
   mu_list_destroy (&mach->action_list);
   mu_list_destroy (&mach->test_list);
diff --git a/libmu_sieve/tests.c b/libmu_sieve/tests.c
index 19fbd84..81eb112 100644
--- a/libmu_sieve/tests.c
+++ b/libmu_sieve/tests.c
@@ -51,7 +51,7 @@ address_aget_t
 sieve_get_address_part (mu_list_t tags)
 {
   address_aget_t ret = mu_address_aget_email;
-  mu_list_do (tags, _get_address_part, &ret);
+  mu_list_foreach (tags, _get_address_part, &ret);
   return ret;
 }
 
diff --git a/libmu_sieve/util.c b/libmu_sieve/util.c
index 1fa7378..6dddfb4 100644
--- a/libmu_sieve/util.c
+++ b/libmu_sieve/util.c
@@ -136,7 +136,7 @@ mu_sieve_slist_destroy (mu_list_t *plist)
 {
   if (!plist)
     return;
-  mu_list_do (*plist, _destroy_item, NULL);
+  mu_list_foreach (*plist, _destroy_item, NULL);
   mu_list_destroy (plist);
 }
 
@@ -344,11 +344,11 @@ sieve_print_value (mu_sieve_value_t *val, mu_stream_t str)
       break;
       
     case SVT_STRING_LIST:
-      mu_list_do (val->v.list, string_printer, str);
+      mu_list_foreach (val->v.list, string_printer, str);
       break;
 
     case SVT_VALUE_LIST:
-      mu_list_do (val->v.list, value_printer, str);
+      mu_list_foreach (val->v.list, value_printer, str);
 
     case SVT_POINTER:
       mu_stream_printf (str, "%p", val->v.ptr);
@@ -386,7 +386,7 @@ tag_printer (void *item, void *data)
 void
 mu_sv_print_tag_list (mu_list_t list, mu_stream_t str)
 {
-  mu_list_do (list, tag_printer, str);
+  mu_list_foreach (list, tag_printer, str);
 }
 
 static int
@@ -409,7 +409,7 @@ mu_sieve_tag_lookup (mu_list_t taglist, char *name, 
mu_sieve_value_t **arg)
   mu_sieve_runtime_tag_t t;
 
   t.tag = name;
-  if (taglist && mu_list_do (taglist, tag_finder, &t))
+  if (taglist && mu_list_foreach (taglist, tag_finder, &t))
     {
       if (arg)
        *arg = t.arg;
@@ -425,7 +425,7 @@ mu_sieve_vlist_do (mu_sieve_value_t *val, mu_list_action_t 
*ac, void *data)
     {
     case SVT_VALUE_LIST:
     case SVT_STRING_LIST:
-      return mu_list_do (val->v.list, ac, data);
+      return mu_list_foreach (val->v.list, ac, data);
       
     default:
       return -1;
diff --git a/libproto/imap/id.c b/libproto/imap/id.c
index 4e03c5d..2ba44ef 100644
--- a/libproto/imap/id.c
+++ b/libproto/imap/id.c
@@ -101,7 +101,7 @@ parse_id_reply (mu_imap_t imap, mu_assoc_t *passoc)
   st.item = 0;
   st.assoc = assoc;
   st.ret = 0;
-  mu_list_do (response->v.list, _id_convert, &st);
+  mu_list_foreach (response->v.list, _id_convert, &st);
   return st.ret;
 }
   
diff --git a/libproto/imap/select.c b/libproto/imap/select.c
index 130bb8d..75e94e6 100644
--- a/libproto/imap/select.c
+++ b/libproto/imap/select.c
@@ -98,7 +98,7 @@ _parse_stat (void *item, void *data)
        {
          if (arg->type != imap_eltype_list)
            return 0;
-         mu_list_do (arg->v.list, _collect_flags,
+         mu_list_foreach (arg->v.list, _collect_flags,
                      &imap->mbox_stat.permanent_flags);
          imap->mbox_stat.flags |= MU_IMAP_STAT_PERMANENT_FLAGS;
        }
@@ -111,7 +111,7 @@ _parse_stat (void *item, void *data)
        return 0;
       if (arg->type != imap_eltype_list)
        return 0;
-      mu_list_do (arg->v.list, _collect_flags, &imap->mbox_stat.defined_flags);
+      mu_list_foreach (arg->v.list, _collect_flags, 
&imap->mbox_stat.defined_flags);
       imap->mbox_stat.flags |= MU_IMAP_STAT_DEFINED_FLAGS;
     }
   else if (count == 2)
@@ -202,7 +202,7 @@ mu_imap_select (mu_imap_t imap, const char *mbox, int 
writable,
            }
          imap->mbox_writable = writable;
          memset (&imap->mbox_stat, 0, sizeof (imap->mbox_stat));
-         mu_list_do (imap->untagged_resp, _parse_stat, imap);
+         mu_list_foreach (imap->untagged_resp, _parse_stat, imap);
          if (ps)
            *ps = imap->mbox_stat;
          break;
diff --git a/libproto/mailer/smtp_mech.c b/libproto/mailer/smtp_mech.c
index e916076..22b7017 100644
--- a/libproto/mailer/smtp_mech.c
+++ b/libproto/mailer/smtp_mech.c
@@ -80,7 +80,7 @@ mu_smtp_add_auth_mech_list (mu_smtp_t smtp, mu_list_t list)
 {
   if (!smtp)
     return EINVAL;
-  return mu_list_do (list, _mech_append, smtp);
+  return mu_list_foreach (list, _mech_append, smtp);
 }
 
 /* Set a list of implemented authentication mechanisms */
@@ -127,7 +127,7 @@ mu_smtp_mech_select (mu_smtp_t smtp, const char **pmech)
     {
       rc = mu_list_create (&alist);
       if (rc == 0)
-       rc = mu_list_do (smtp->authimpl, _mech_copy, alist);
+       rc = mu_list_foreach (smtp->authimpl, _mech_copy, alist);
     }
   else
     {
diff --git a/maidag/lmtp.c b/maidag/lmtp.c
index 12f4214..0273e20 100644
--- a/maidag/lmtp.c
+++ b/maidag/lmtp.c
@@ -381,7 +381,7 @@ cfun_data (mu_stream_t iostr, char *arg)
       maidag_error (_("copy error: %s"), mu_strerror (rc));
       mu_stream_destroy (&flt);
       mu_stream_destroy (&tempstr);
-      mu_list_do (rcpt_list, dot_temp_fail, iostr);
+      mu_list_foreach (rcpt_list, dot_temp_fail, iostr);
     }
 
   lmtp_reply (iostr, "354", NULL, "Go ahead");
@@ -413,7 +413,7 @@ cfun_data (mu_stream_t iostr, char *arg)
   if (rc)
     {
       maidag_error (_("copy error: %s"), mu_strerror (rc));
-      mu_list_do (rcpt_list, dot_temp_fail, iostr);
+      mu_list_foreach (rcpt_list, dot_temp_fail, iostr);
     }
 
   rc = mu_stream_to_message (tempstr, &mesg);
@@ -422,14 +422,14 @@ cfun_data (mu_stream_t iostr, char *arg)
     {
       maidag_error (_("error creating temporary message: %s"),
                    mu_strerror (rc));
-      mu_list_do (rcpt_list, dot_temp_fail, iostr);
+      mu_list_foreach (rcpt_list, dot_temp_fail, iostr);
     }
   
-  rc = mu_list_do (rcpt_list, dot_deliver, iostr);
+  rc = mu_list_foreach (rcpt_list, dot_deliver, iostr);
 
   mu_message_destroy (&mesg, mu_message_get_owner (mesg));
   if (rc)
-    mu_list_do (rcpt_list, dot_temp_fail, iostr);
+    mu_list_foreach (rcpt_list, dot_temp_fail, iostr);
 
   return 0;
 }
diff --git a/maidag/script.c b/maidag/script.c
index 36145de..750c458 100644
--- a/maidag/script.c
+++ b/maidag/script.c
@@ -162,7 +162,7 @@ script_apply (mu_message_t msg, struct mu_auth_data *auth)
       if (switch_user_id (auth, 1) == 0)
        {
          chdir (auth->dir);
-         rc = mu_list_do (script_list, apply_script, &clos);
+         rc = mu_list_foreach (script_list, apply_script, &clos);
          chdir ("/");
          switch_user_id (auth, 0);
        }
diff --git a/mail/send.c b/mail/send.c
index a150875..12270d2 100644
--- a/mail/send.c
+++ b/mail/send.c
@@ -112,13 +112,13 @@ int
 mail_sendheader (int argc, char **argv)
 {
   if (argc == 1)
-    mu_list_do (add_header_list, list_headers, NULL);
+    mu_list_foreach (add_header_list, list_headers, NULL);
   else if (argc == 2)
     {
       if (strchr (argv[1], ':'))
        send_append_header (argv[1]);
       else
-       mu_list_do (add_header_list, list_headers, argv[1]);
+       mu_list_foreach (add_header_list, list_headers, argv[1]);
     }
   else
     {
@@ -207,7 +207,7 @@ void
 compose_init (compose_env_t * env)
 {
   memset (env, 0, sizeof (*env));
-  mu_list_do (add_header_list, seed_headers, env);
+  mu_list_foreach (add_header_list, seed_headers, env);
 }
 
 int
diff --git a/mail/util.c b/mail/util.c
index bb5a905..b008048 100644
--- a/mail/util.c
+++ b/mail/util.c
@@ -1061,7 +1061,7 @@ _run_and_free (void *item, void *data)
 void
 util_run_cached_commands (mu_list_t *list)
 {
-  mu_list_do (*list, _run_and_free, NULL);
+  mu_list_foreach (*list, _run_and_free, NULL);
   mu_list_destroy (list);
 }
 
diff --git a/mh/mark.c b/mh/mark.c
index ba8c5df..da9297e 100644
--- a/mh/mark.c
+++ b/mh/mark.c
@@ -222,7 +222,7 @@ main (int argc, char **argv)
          mu_error (_("--add requires at least one --sequence argument"));
          return 1;
        }
-      mu_list_do (seq_list, action_add, (void *) &clos);
+      mu_list_foreach (seq_list, action_add, (void *) &clos);
       mh_global_save_state ();
       break;
       
@@ -232,7 +232,7 @@ main (int argc, char **argv)
          mu_error (_("--delete requires at least one --sequence argument"));
          return 1;
        }
-      mu_list_do (seq_list, action_delete, (void *) &clos);
+      mu_list_foreach (seq_list, action_delete, (void *) &clos);
       mh_global_save_state ();
       break;
       
@@ -240,7 +240,7 @@ main (int argc, char **argv)
       if (!seq_list)
        list_all (mbox);
       else
-       mu_list_do (seq_list, action_list, &clos);
+       mu_list_foreach (seq_list, action_list, &clos);
       break;
     }
   mu_mailbox_close (mbox);
diff --git a/mh/mh_format.c b/mh/mh_format.c
index 22a6ace..0e51496 100644
--- a/mh/mh_format.c
+++ b/mh/mh_format.c
@@ -454,7 +454,7 @@ addr_cmp (void *item, void *data)
 static int
 addrlist_lookup (mu_list_t list, mu_address_t addr)
 {
-  return mu_list_do (list, addr_cmp, addr);
+  return mu_list_foreach (list, addr_cmp, addr);
 }
 
 static int
@@ -468,7 +468,7 @@ addr_free (void *item, void *data)
 static void
 addrlist_destroy (mu_list_t *list)
 {
-  mu_list_do (*list, addr_free, NULL);
+  mu_list_foreach (*list, addr_free, NULL);
   mu_list_destroy (list);
 }
 
diff --git a/mh/mh_list.c b/mh/mh_list.c
index ebedf41..bcf6aa6 100644
--- a/mh/mh_list.c
+++ b/mh/mh_list.c
@@ -356,7 +356,7 @@ _destroy_stmt (void *item, void *data)
 void
 mhl_format_destroy (mu_list_t *fmt)
 {
-  mu_list_do (*fmt, _destroy_stmt, NULL);
+  mu_list_foreach (*fmt, _destroy_stmt, NULL);
   mu_list_destroy (fmt);
 }
 
@@ -474,7 +474,7 @@ _comp_name (void *item, void *date)
 int
 header_is_printed (struct eval_env *env, const char *name)
 {
-  return mu_list_do (env->printed_fields, _comp_name, (void*) name) == 1;
+  return mu_list_foreach (env->printed_fields, _comp_name, (void*) name) == 1;
 }
 
 int
@@ -781,7 +781,7 @@ eval_comp (struct eval_env *env, char *compname, mu_list_t 
format)
 {
   struct eval_env lenv = *env;
   
-  mu_list_do (format, eval_stmt, &lenv);
+  mu_list_foreach (format, eval_stmt, &lenv);
 
   goto_offset (&lenv, lenv.ivar[I_OFFSET]);
 
@@ -852,7 +852,7 @@ mhl_format_run (mu_list_t fmt,
   env.nlines = 0;
   env.msg = msg;
   env.output = output;
-  rc = mu_list_do (fmt, eval_stmt, &env);
+  rc = mu_list_foreach (fmt, eval_stmt, &env);
   mu_list_destroy (&env.printed_fields);
   return rc;
 }
diff --git a/mh/mh_whatnow.c b/mh/mh_whatnow.c
index ad27490..4b4b210 100644
--- a/mh/mh_whatnow.c
+++ b/mh/mh_whatnow.c
@@ -307,7 +307,7 @@ annotate (struct mh_whatnow_env *wh)
          d.field = wh->anno_field;
          d.date = i == 1;
          mu_address_to_string (subaddr, d.value, size + 1, NULL);
-         mu_list_do (wh->anno_list, anno, &d);
+         mu_list_foreach (wh->anno_list, anno, &d);
          free (d.value);
          mu_address_destroy (&subaddr);
        }
diff --git a/mh/mh_whom.c b/mh/mh_whom.c
index cd5abeb..30a295c 100644
--- a/mh/mh_whom.c
+++ b/mh/mh_whom.c
@@ -152,7 +152,7 @@ destroy_addrs (mu_list_t *list)
 {
   if (!*list)
     return;
-  mu_list_do (*list, _destroy_recipient, NULL);
+  mu_list_foreach (*list, _destroy_recipient, NULL);
   mu_list_destroy (list);
 }
 
@@ -296,13 +296,13 @@ mh_whom (const char *filename, int check)
       if (local_rcp)
        {
          printf ("  %s\n", _("-- Local Recipients --"));
-         mu_list_do (local_rcp, _print_local_recipient, &count);
+         mu_list_foreach (local_rcp, _print_local_recipient, &count);
        }
 
       if (network_rcp)
        {
          printf ("  %s\n", _("-- Network Recipients --"));
-         mu_list_do (network_rcp, _print_recipient, &count);
+         mu_list_foreach (network_rcp, _print_recipient, &count);
        }
 
       if (count == 0)
diff --git a/mh/pick.c b/mh/pick.c
index db7aa43..c819a29 100644
--- a/mh/pick.c
+++ b/mh/pick.c
@@ -410,7 +410,7 @@ main (int argc, char **argv)
       msgset.list = obstack_finish (&msgno_stk);
       clos.mbox = mbox;
       clos.msgset = &msgset;
-      mu_list_do (seq_list, action_add, &clos);
+      mu_list_foreach (seq_list, action_add, &clos);
     }
 
   mh_global_save_state ();
diff --git a/mh/send.c b/mh/send.c
index 1f015a7..b654f10 100644
--- a/mh/send.c
+++ b/mh/send.c
@@ -838,7 +838,7 @@ main (int argc, char **argv)
   free (p);
   
   /* Finally, do the work */
-  rc = mu_list_do (mesg_list, _action_send, NULL);
+  rc = mu_list_foreach (mesg_list, _action_send, NULL);
 
   mu_mailbox_destroy (&mbox);
   return !!rc;
diff --git a/mh/sortm.c b/mh/sortm.c
index 3a34b10..841e4eb 100644
--- a/mh/sortm.c
+++ b/mh/sortm.c
@@ -243,7 +243,7 @@ remop (compfun comp)
   struct rem_data d;
   d.comp = comp;
   d.op = NULL;
-  mu_list_do (oplist, rem_action, &d);
+  mu_list_foreach (oplist, rem_action, &d);
   mu_list_remove (oplist, d.op);
 }
 
@@ -297,7 +297,7 @@ compare_messages (mu_message_t a, mu_message_t b, size_t 
anum, size_t bnum)
   d.r = 0;
   d.m[0] = a;
   d.m[1] = b;
-  mu_list_do (oplist, compare_action, &d);
+  mu_list_foreach (oplist, compare_action, &d);
   if (d.r == 0)
     {
       if (anum < bnum)
diff --git a/mimeview/mimetypes.y b/mimeview/mimetypes.y
index b71f628..3250384 100644
--- a/mimeview/mimetypes.y
+++ b/mimeview/mimetypes.y
@@ -702,7 +702,7 @@ const char *
 get_file_type ()
 {
   const char *type = NULL;
-  mu_list_do (rule_list, evaluate, &type);
+  mu_list_foreach (rule_list, evaluate, &type);
   return type;
 }
     
diff --git a/mu/dbm.c b/mu/dbm.c
index ee217ca..1408d58 100644
--- a/mu/dbm.c
+++ b/mu/dbm.c
@@ -1419,7 +1419,7 @@ delete_database (int argc, char **argv)
        free_regexes (&m);
       }
     }
-  mu_list_do (templist, do_delete, db);
+  mu_list_foreach (templist, do_delete, db);
   mu_list_destroy (&templist);
   mu_dbm_destroy (&db);
 }
diff --git a/mu/filter.c b/mu/filter.c
index 8821e64..0639fc2 100644
--- a/mu/filter.c
+++ b/mu/filter.c
@@ -95,7 +95,7 @@ list_filters ()
       mu_diag_funcall (MU_DIAG_ERROR, "mu_filter_get_list", NULL, rc);
       return 1;
     }
-  return mu_list_do (list, filter_printer, NULL);
+  return mu_list_foreach (list, filter_printer, NULL);
 }
 
 static int
diff --git a/sql/odbc.c b/sql/odbc.c
index c2d5381..c476f6b 100644
--- a/sql/odbc.c
+++ b/sql/odbc.c
@@ -188,7 +188,7 @@ static int
 odbc_release_result (mu_sql_connection_t conn)
 {
   struct mu_odbc_data *dp = conn->data;
-  mu_list_do (dp->result, odbc_free_char_data, NULL);
+  mu_list_foreach (dp->result, odbc_free_char_data, NULL);
   mu_list_destroy (&dp->result);
   mu_argcv_free (dp->fcount, dp->fnames);
   dp->fcount = 0;
diff --git a/testsuite/smtpsend.c b/testsuite/smtpsend.c
index 7eaa670..9dcc4e7 100644
--- a/testsuite/smtpsend.c
+++ b/testsuite/smtpsend.c
@@ -250,7 +250,7 @@ main (int argc, char **argv)
     }
   
   MU_ASSERT (mu_smtp_mail_basic (smtp, from, NULL));
-  mu_list_do (rcpt_list, send_rcpt_command, smtp);
+  mu_list_foreach (rcpt_list, send_rcpt_command, smtp);
   
   if (raw)
     {


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]