Commit a70b333f a70b333f19641fa2360bd08d77dbb5d45c999934 by Sergey Poznyakoff

(mailbox_lock, mailbox_unlock): New functions.

1 parent be7908c6
...@@ -78,6 +78,10 @@ extern int mailbox_set_debug __P ((mailbox_t, mu_debug_t)); ...@@ -78,6 +78,10 @@ extern int mailbox_set_debug __P ((mailbox_t, mu_debug_t));
78 /* Events. */ 78 /* Events. */
79 extern int mailbox_get_observable __P ((mailbox_t, observable_t *)); 79 extern int mailbox_get_observable __P ((mailbox_t, observable_t *));
80 80
81 /* Locking */
82 extern int mailbox_lock __P ((mailbox_t mbox));
83 extern int mailbox_unlock __P ((mailbox_t mbox));
84
81 #ifdef __cplusplus 85 #ifdef __cplusplus
82 } 86 }
83 #endif 87 #endif
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 5 modify it under the terms of the GNU Lesser General Public
...@@ -257,6 +257,7 @@ mailbox_messages_recent (mailbox_t mbox, size_t *num) ...@@ -257,6 +257,7 @@ mailbox_messages_recent (mailbox_t mbox, size_t *num)
257 return MU_ERR_EMPTY_VFN; 257 return MU_ERR_EMPTY_VFN;
258 return mbox->_messages_recent (mbox, num); 258 return mbox->_messages_recent (mbox, num);
259 } 259 }
260
260 int 261 int
261 mailbox_message_unseen (mailbox_t mbox, size_t *num) 262 mailbox_message_unseen (mailbox_t mbox, size_t *num)
262 { 263 {
...@@ -492,3 +493,20 @@ mailbox_set_folder (mailbox_t mbox, folder_t folder) ...@@ -492,3 +493,20 @@ mailbox_set_folder (mailbox_t mbox, folder_t folder)
492 mbox->folder = folder; 493 mbox->folder = folder;
493 return 0; 494 return 0;
494 } 495 }
496
497 int
498 mailbox_lock (mailbox_t mbox)
499 {
500 locker_t lock = NULL;
501 mailbox_get_locker (mbox, &lock);
502 return locker_lock (lock);
503 }
504
505 int
506 mailbox_unlock (mailbox_t mbox)
507 {
508 locker_t lock = NULL;
509 mailbox_get_locker (mbox, &lock);
510 return locker_unlock (lock);
511 }
512
......