* fix 'make gitcheck' for guile, part I

This commit is contained in:
Dirk-Jan C. Binnema 2011-07-21 00:47:39 +03:00
parent e390743195
commit 651493d47e
2 changed files with 22 additions and 17 deletions

View File

@ -19,7 +19,7 @@ include $(top_srcdir)/gtest.mk
# note, we need top_builddir for snarfing with 'make distcheck' (ie.,
# with separate builddir)
SUBDIRS= .
INCLUDES=-I${top_builddir} -I${top_srcdir} -I${top_srcdir}/src ${GUILE_CFLAGS} ${GLIB_CFLAGS}
INCLUDES=-I. -I${top_builddir} -I${top_srcdir}/src -I${top_srcdir}/libmuguile ${GUILE_CFLAGS} ${GLIB_CFLAGS}
# don't use -Werror, as it might break on other compilers
# use -Wno-unused-parameters, because some callbacks may not

View File

@ -62,6 +62,26 @@ get_query_iter (MuQuery *query, const char* expr)
}
static void
call_func (SCM FUNC, MuMsgIter *iter, const char* func_name)
{
SCM msgsmob;
MuMsg *msg;
GError *err;
err = NULL;
msg = mu_msg_iter_get_msg (iter, &err);
if (err) {
mu_guile_g_error (func_name, err);
g_error_free (err);
return;
}
msgsmob = mu_guile_msg_to_scm (mu_msg_ref(msg));
scm_call_1 (FUNC, msgsmob);
}
SCM_DEFINE (store_foreach, "mu:store:for-each", 1, 1, 0,
(SCM FUNC, SCM EXPR),
"Call FUNC for each message in the store, or, if EXPR is specified, "
@ -88,22 +108,7 @@ SCM_DEFINE (store_foreach, "mu:store:for-each", 1, 1, 0,
return SCM_UNSPECIFIED;
for (count = 0; !mu_msg_iter_is_done(iter); mu_msg_iter_next (iter)) {
SCM msgsmob;
MuMsg *msg;
GError *err;
err = NULL;
msg = mu_msg_iter_get_msg (iter, &err);
if (err) {
mu_guile_g_error (FUNC_NAME, err);
g_error_free (err);
continue;
}
msgsmob = mu_guile_msg_to_scm (mu_msg_ref(msg));
scm_call_1 (FUNC, msgsmob);
call_func (FUNC, iter, FUNC_NAME);
++count;
}