Implement two new Scheme functions.
* NEWS: Update. * configure.ac: Version 2.99.97 * libmu_scm/mu_mailbox.c (mu-mailbox-sync) (mu-mailbox-flush): New functions.
Showing
3 changed files
with
66 additions
and
3 deletions
1 | GNU mailutils NEWS -- history of user-visible changes. 2012-05-31 | 1 | GNU mailutils NEWS -- history of user-visible changes. 2012-06-07 |
2 | Copyright (C) 2002-2012 Free Software Foundation, Inc. | 2 | Copyright (C) 2002-2012 Free Software Foundation, Inc. |
3 | See the end of file for copying conditions. | 3 | See the end of file for copying conditions. |
4 | 4 | ||
5 | Please send mailutils bug reports to <bug-mailutils@gnu.org>. | 5 | Please send mailutils bug reports to <bug-mailutils@gnu.org>. |
6 | 6 | ||
7 | 7 | ||
8 | Version 2.99.96 (Git) | 8 | Version 2.99.97 (Git) |
9 | 9 | ||
10 | This version is a major rewrite of GNU Mailutils. Quite a few parts | 10 | This version is a major rewrite of GNU Mailutils. Quite a few parts |
11 | of the basic framework were rewritten from scratch, while some others | 11 | of the basic framework were rewritten from scratch, while some others |
... | @@ -254,6 +254,24 @@ See <http://mailutils.org/wiki/debug_level>. | ... | @@ -254,6 +254,24 @@ See <http://mailutils.org/wiki/debug_level>. |
254 | 254 | ||
255 | ** Configuration file support (libmu_cfg) rewritten. | 255 | ** Configuration file support (libmu_cfg) rewritten. |
256 | 256 | ||
257 | * New Scheme primitives | ||
258 | |||
259 | ** mu-mailbox-sync | ||
260 | |||
261 | Synchronizes the changes done to the mailbox with its external | ||
262 | storage. | ||
263 | |||
264 | ** mu-mailbox-expunge | ||
265 | |||
266 | Similar to mu-mailbox-sync, but also permanently removes messages | ||
267 | marked for deletion. | ||
268 | |||
269 | ** mu-mailbox-flush | ||
270 | |||
271 | Marks all messages as seen, and synchronizes the changes with the | ||
272 | mailbox external storage. Depending on its second argument, removes | ||
273 | messages marked for deletion. | ||
274 | |||
257 | 275 | ||
258 | Version 2.2 - 2010-09-08 | 276 | Version 2.2 - 2010-09-08 |
259 | 277 | ... | ... |
... | @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License along | ... | @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License along |
16 | dnl with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | 16 | dnl with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | AC_PREREQ(2.63) | 18 | AC_PREREQ(2.63) |
19 | AC_INIT([GNU Mailutils], [2.99.96], [bug-mailutils@gnu.org], [mailutils]) | 19 | AC_INIT([GNU Mailutils], [2.99.97], [bug-mailutils@gnu.org], [mailutils]) |
20 | AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c]) | 20 | AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c]) |
21 | AC_CONFIG_AUX_DIR([build-aux]) | 21 | AC_CONFIG_AUX_DIR([build-aux]) |
22 | AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 dist-xz std-options silent-rules]) | 22 | AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 dist-xz std-options silent-rules]) | ... | ... |
... | @@ -373,6 +373,51 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0, | ... | @@ -373,6 +373,51 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0, |
373 | } | 373 | } |
374 | #undef FUNC_NAME | 374 | #undef FUNC_NAME |
375 | 375 | ||
376 | SCM_DEFINE_PUBLIC (scm_mu_mailbox_sync, "mu-mailbox-sync", 1, 0, 0, | ||
377 | (SCM mbox), | ||
378 | "Synchronize changes to @var{mbox} with its storage.") | ||
379 | #define FUNC_NAME s_scm_mu_mailbox_sync | ||
380 | { | ||
381 | struct mu_mailbox *mum; | ||
382 | int status; | ||
383 | |||
384 | SCM_ASSERT (mu_scm_is_mailbox (mbox), mbox, SCM_ARG1, FUNC_NAME); | ||
385 | mum = (struct mu_mailbox *) SCM_CDR (mbox); | ||
386 | status = mu_mailbox_sync (mum->mbox); | ||
387 | if (status) | ||
388 | mu_scm_error (FUNC_NAME, status, | ||
389 | "Sync failed for mailbox ~A", | ||
390 | scm_list_1 (mbox)); | ||
391 | return SCM_BOOL_T; | ||
392 | } | ||
393 | #undef FUNC_NAME | ||
394 | |||
395 | SCM_DEFINE_PUBLIC (scm_mu_mailbox_flush, "mu-mailbox-flush", 1, 1, 0, | ||
396 | (SCM mbox, SCM expunge), | ||
397 | "Mark all messages in @var{mbox} as seen and synchronize all changes with " | ||
398 | "its storage. If @var{expunge} is @samp{#t}, expunge deleted messages " | ||
399 | "as well.") | ||
400 | #define FUNC_NAME s_scm_mu_mailbox_flush | ||
401 | { | ||
402 | struct mu_mailbox *mum; | ||
403 | int status, do_expunge = 0; | ||
404 | |||
405 | SCM_ASSERT (mu_scm_is_mailbox (mbox), mbox, SCM_ARG1, FUNC_NAME); | ||
406 | mum = (struct mu_mailbox *) SCM_CDR (mbox); | ||
407 | if (!SCM_UNBNDP (expunge)) | ||
408 | { | ||
409 | SCM_ASSERT (scm_is_bool (expunge), expunge, SCM_ARG2, FUNC_NAME); | ||
410 | do_expunge = expunge == SCM_BOOL_T; | ||
411 | } | ||
412 | status = mu_mailbox_flush (mum->mbox, do_expunge); | ||
413 | if (status) | ||
414 | mu_scm_error (FUNC_NAME, status, | ||
415 | "Flush failed for mailbox ~A", | ||
416 | scm_list_1 (mbox)); | ||
417 | return SCM_BOOL_T; | ||
418 | } | ||
419 | #undef FUNC_NAME | ||
420 | |||
376 | SCM_DEFINE_PUBLIC (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0, | 421 | SCM_DEFINE_PUBLIC (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0, |
377 | (SCM mbox, SCM mesg), | 422 | (SCM mbox, SCM mesg), |
378 | "Appends message @var{mesg} to the mailbox @var{mbox}.") | 423 | "Appends message @var{mesg} to the mailbox @var{mbox}.") | ... | ... |
-
Please register or sign in to post a comment