[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Mailutils branch, master, updated. release-3.1-7-g7c9c6b5
From: |
Sergey Poznyakoff |
Subject: |
[SCM] GNU Mailutils branch, master, updated. release-3.1-7-g7c9c6b5 |
Date: |
Thu, 15 Dec 2016 11:18:44 +0000 (UTC) |
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=7c9c6b5f16940e8bf263e0eb0ee3fbc4b55d5aad
The branch, master has been updated
via 7c9c6b5f16940e8bf263e0eb0ee3fbc4b55d5aad (commit)
via 3b42a3a50217575fee4d222204f53e786eb35965 (commit)
from 259efd3458b4282915f7bc7333c8c0a5e8c0c757 (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 7c9c6b5f16940e8bf263e0eb0ee3fbc4b55d5aad
Author: Sergey Poznyakoff <address@hidden>
Date: Thu Dec 15 12:09:51 2016 +0200
Export mu-mailer guile variable
* libmu_scm/mu_scm.c: Export mu-mailer.
* libmu_scm/mu_message.c (scm_mu_message_send): Fix a typo.
commit 3b42a3a50217575fee4d222204f53e786eb35965
Author: Sergey Poznyakoff <address@hidden>
Date: Thu Dec 15 10:28:13 2016 +0200
Swap precedences of MH and Maildir to help in format autodetection
* include/mailutils/registrar.h: Swap MU_MAILDIR_PRIO and
MU_MH_PRIO
(mu_record_is_local)
(mu_registrar_apply_filter): New protos.
* libmailutils/base/registrar.c (mu_registrar_set_default_scheme): Use
mu_registrar_set_default_record.
(mu_record_is_local): New function.
(mu_record_get_url): Use it.
(mu_registrar_apply_filter): New function.
-----------------------------------------------------------------------
Summary of changes:
include/mailutils/registrar.h | 7 +++++--
libmailutils/base/registrar.c | 36 +++++++++++++++++++++++++++++++++---
libmu_scm/mu_message.c | 2 +-
libmu_scm/mu_scm.c | 4 +++-
4 files changed, 42 insertions(+), 7 deletions(-)
diff --git a/include/mailutils/registrar.h b/include/mailutils/registrar.h
index 0fb5e51..eeecaa5 100644
--- a/include/mailutils/registrar.h
+++ b/include/mailutils/registrar.h
@@ -75,7 +75,10 @@ int mu_registrar_lookup_url (mu_url_t url, int flags,
mu_record_t *precord, int *pflags);
int mu_registrar_record (mu_record_t);
int mu_unregistrar_record (mu_record_t);
+int mu_registrar_apply_filter (int (*flt) (mu_record_t, void *), void *data);
+int mu_record_is_local (mu_record_t);
+
/* Scheme. */
int mu_record_is_scheme (mu_record_t, mu_url_t, int flags);
@@ -113,8 +116,8 @@ extern mu_record_t mu_maildir_record;
#define MU_IMAP_PRIO 100
#define MU_POP_PRIO 200
#define MU_MBOX_PRIO 300
-#define MU_MH_PRIO 400
-#define MU_MAILDIR_PRIO 500
+#define MU_MAILDIR_PRIO 400
+#define MU_MH_PRIO 500
#define MU_NNTP_PRIO 600
#define MU_PATH_PRIO 1000
diff --git a/libmailutils/base/registrar.c b/libmailutils/base/registrar.c
index fe856ec..ba9c34e 100644
--- a/libmailutils/base/registrar.c
+++ b/libmailutils/base/registrar.c
@@ -70,12 +70,12 @@ mu_registrar_set_default_scheme (const char *scheme)
status = mu_registrar_lookup_scheme (scheme, &rec);
if (status == 0)
- mu_default_record = rec;
+ mu_registrar_set_default_record (rec);
return status;
}
const char *
-mu_registrar_get_default_scheme ()
+mu_registrar_get_default_scheme (void)
{
return mu_default_record ? mu_default_record->scheme : NULL;
}
@@ -279,6 +279,12 @@ mu_record_is_scheme (mu_record_t record, mu_url_t url, int
flags)
}
int
+mu_record_is_local (mu_record_t record)
+{
+ return record->flags & MU_RECORD_LOCAL;
+}
+
+int
mu_record_get_url (mu_record_t record, int (*(*_purl)) (mu_url_t))
{
if (record == NULL)
@@ -393,6 +399,30 @@ mu_registrar_test_local_url (mu_url_t url, int *pres)
rc = mu_registrar_lookup_url (url, MU_FOLDER_ATTRIBUTE_ALL, &rec, NULL);
if (rc)
return rc;
- *pres = rec->flags & MU_RECORD_LOCAL;
+ *pres = mu_record_is_local (rec);
+ return 0;
+}
+
+/* Apply flt to each record in the registry and remove those, for which it
+ returns non-zero. */
+int
+mu_registrar_apply_filter (int (*flt) (mu_record_t, void *), void *data)
+{
+ mu_iterator_t iterator;
+
+ int status = mu_registrar_get_iterator (&iterator);
+ if (status != 0)
+ return status;
+ mu_monitor_wrlock (®istrar_monitor);
+ for (mu_iterator_first (iterator); !mu_iterator_is_done (iterator);
+ mu_iterator_next (iterator))
+ {
+ mu_record_t record;
+ mu_iterator_current (iterator, (void **)&record);
+ if (flt (record, data))
+ mu_list_remove (registrar_list, record);
+ }
+ mu_iterator_destroy (&iterator);
+ mu_monitor_unlock (®istrar_monitor);
return 0;
}
diff --git a/libmu_scm/mu_message.c b/libmu_scm/mu_message.c
index e8bc07f..715d5c1 100644
--- a/libmu_scm/mu_message.c
+++ b/libmu_scm/mu_message.c
@@ -1068,7 +1068,7 @@ SCM_DEFINE_PUBLIC (scm_mu_message_send,
"mu-message-send", 1, 3, 0,
status = mu_mailer_create (&mailer_c, mailer_name);
free (mailer_name);
if (status)
- mu_scm_error (FUNC_NAME, status, "Cannot get create mailer", SCM_BOOL_F);
+ mu_scm_error (FUNC_NAME, status, "Cannot create mailer", SCM_BOOL_F);
if (scm_to_int (MU_SCM_SYMBOL_VALUE ("mu-debug")))
{
diff --git a/libmu_scm/mu_scm.c b/libmu_scm/mu_scm.c
index 98b4fb1..9b09099 100644
--- a/libmu_scm/mu_scm.c
+++ b/libmu_scm/mu_scm.c
@@ -175,9 +175,11 @@ mu_scm_init ()
_mu_scm_mailer = scm_from_locale_string ("sendmail:" PATH_SENDMAIL);
scm_c_define ("mu-mailer", _mu_scm_mailer);
-
+ scm_c_export ("mu-mailer", NULL);
+
_mu_scm_debug = scm_from_int (0);
scm_c_define ("mu-debug", _mu_scm_debug);
+ scm_c_export ("mu-debug", NULL);
_mu_scm_package = scm_from_locale_string (PACKAGE);
scm_c_define ("mu-package", _mu_scm_package);
hooks/post-receive
--
GNU Mailutils
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Mailutils branch, master, updated. release-3.1-7-g7c9c6b5,
Sergey Poznyakoff <=