Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
530953e1
...
530953e151f011eb2f57918039c402f475431a09
authored
2011-11-19 16:08:48 +0200
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Rename mu_list_do to mu_list_foreach. Add comments to mailutils/list.h
1 parent
c96bc2c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
89 additions
and
81 deletions
imap4d/authenticate.c
imap4d/capability.c
imap4d/fetch.c
imap4d/namespace.c
imap4d/util.c
include/mailutils/list.h
libmailutils/auth/auth.c
libmailutils/cfg/driver.c
libmailutils/cfg/format.c
libmailutils/cfg/gocs.c
libmailutils/cfg/parser.y
libmailutils/list/Makefile.am
libmailutils/list/do.c → libmailutils/list/foreach.c
libmailutils/server/acl.c
libmailutils/server/msrv.c
libmu_cpp/list.cc
libmu_sieve/comparator.c
libmu_sieve/conf.c
libmu_sieve/load.c
libmu_sieve/prog.c
libmu_sieve/sieve.l
libmu_sieve/sieve.y
libmu_sieve/tests.c
libmu_sieve/util.c
libproto/imap/id.c
libproto/imap/select.c
libproto/mailer/smtp_mech.c
maidag/lmtp.c
maidag/script.c
mail/send.c
mail/util.c
mh/mark.c
mh/mh_format.c
mh/mh_list.c
mh/mh_whatnow.c
mh/mh_whom.c
mh/pick.c
mh/send.c
mh/sortm.c
mimeview/mimetypes.y
mu/dbm.c
mu/filter.c
sql/odbc.c
testsuite/smtpsend.c
imap4d/authenticate.c
View file @
530953e
...
...
@@ -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
)
{
...
...
imap4d/capability.c
View file @
530953e
...
...
@@ -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
"
);
...
...
imap4d/fetch.c
View file @
530953e
...
...
@@ -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
"
);
}
}
...
...
imap4d/namespace.c
View file @
530953e
...
...
@@ -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
;
...
...
imap4d/util.c
View file @
530953e
...
...
@@ -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
...
...
include/mailutils/list.h
View file @
530953e
This diff is collapsed.
Click to expand it.
libmailutils/auth/auth.c
View file @
530953e
...
...
@@ -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
;
...
...
libmailutils/cfg/driver.c
View file @
530953e
...
...
@@ -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
:
...
...
libmailutils/cfg/format.c
View file @
530953e
...
...
@@ -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
);
}
}
...
...
libmailutils/cfg/gocs.c
View file @
530953e
...
...
@@ -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
);
...
...
libmailutils/cfg/parser.y
View file @
530953e
...
...
@@ -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)
...
...
libmailutils/list/Makefile.am
View file @
530953e
...
...
@@ -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
\
...
...
libmailutils/list/
do
.c
→
libmailutils/list/
foreach
.c
View file @
530953e
...
...
@@ -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
);
}
...
...
libmailutils/server/acl.c
View file @
530953e
...
...
@@ -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
;
...
...
libmailutils/server/msrv.c
View file @
530953e
...
...
@@ -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
));
...
...
libmu_cpp/list.cc
View file @
530953e
...
...
@@ -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
);
}
...
...
libmu_sieve/comparator.c
View file @
530953e
...
...
@@ -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
);
}
...
...
libmu_sieve/conf.c
View file @
530953e
...
...
@@ -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
);
...
...
libmu_sieve/load.c
View file @
530953e
...
...
@@ -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
;
...
...
libmu_sieve/prog.c
View file @
530953e
...
...
@@ -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
);
}
}
...
...
libmu_sieve/sieve.l
View file @
530953e
...
...
@@ -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);
...
...
libmu_sieve/sieve.y
View file @
530953e
...
...
@@ -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);
...
...
libmu_sieve/tests.c
View file @
530953e
...
...
@@ -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
;
}
...
...
libmu_sieve/util.c
View file @
530953e
...
...
@@ -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
;
...
...
libproto/imap/id.c
View file @
530953e
...
...
@@ -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
;
}
...
...
libproto/imap/select.c
View file @
530953e
...
...
@@ -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
;
...
...
libproto/mailer/smtp_mech.c
View file @
530953e
...
...
@@ -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
{
...
...
maidag/lmtp.c
View file @
530953e
...
...
@@ -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
;
}
...
...
maidag/script.c
View file @
530953e
...
...
@@ -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
);
}
...
...
mail/send.c
View file @
530953e
...
...
@@ -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
...
...
mail/util.c
View file @
530953e
...
...
@@ -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
);
}
...
...
mh/mark.c
View file @
530953e
...
...
@@ -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
);
...
...
mh/mh_format.c
View file @
530953e
...
...
@@ -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
);
}
...
...
mh/mh_list.c
View file @
530953e
...
...
@@ -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
;
}
...
...
mh/mh_whatnow.c
View file @
530953e
...
...
@@ -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
);
}
...
...
mh/mh_whom.c
View file @
530953e
...
...
@@ -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
)
...
...
mh/pick.c
View file @
530953e
...
...
@@ -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
();
...
...
mh/send.c
View file @
530953e
...
...
@@ -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
;
...
...
mh/sortm.c
View file @
530953e
...
...
@@ -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
)
...
...
mimeview/mimetypes.y
View file @
530953e
...
...
@@ -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;
}
...
...
mu/dbm.c
View file @
530953e
...
...
@@ -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
);
}
...
...
mu/filter.c
View file @
530953e
...
...
@@ -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
...
...
sql/odbc.c
View file @
530953e
...
...
@@ -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
;
...
...
testsuite/smtpsend.c
View file @
530953e
...
...
@@ -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
)
{
...
...
Please
register
or
sign in
to post a comment