Commit 2957e3e3 2957e3e3ba5525fb836842f3b20b3b411c2d21dd by Sean 'Shaleh' Perry

added mailbox_lock_t type and appropiate changes

added name to authors file
1 parent 6ec2f70b
Jakob Kaivo <jkaivo@ndn.net>
Jeff Bailey <jbailey@gnu.org>
Sean 'Shaleh' Perry <shaleh@debian.org>
......
Sean 'Shaleh' Perry <shaleh@debian.org> Mon, 4 Oct 1999 14:28:35 -0700
* changed lock(int mode) to lock(mailbox_lock_t mode), this will allow
the type to be chnaged later without affecting code compatibility
* added name to AUTHORS
* noticed mention of IMAP4 server and went back to coding it (-:
1999-10-03 Jeff Bailey <jbailey@cr499794-a.crdva1.bc.wave.home.com>
* mail/mail.c: Support --help, --version.
......
......@@ -38,9 +38,13 @@
#define mbox_lock(m,n) m->_lock(m,n)
/* Lock settings */
#define MO_ULOCK 0
#define MO_RLOCK 1
#define MO_WLOCK 2
/*
* define this way so that it is opaque and can later become a struct w/o
* people noticing (-:
*
*/
enum _mailbox_lock_t {MO_ULOCK, MO_RLOCK, MO_WLOCK}; /* new type */
typedef enum _mailbox_lock_t mailbox_lock_t;
typedef struct _mailbox
{
......@@ -58,7 +62,7 @@ typedef struct _mailbox
int (*_expunge) __P ((struct _mailbox *));
int (*_add_message) __P ((struct _mailbox *, char *));
int (*_is_deleted) __P ((struct _mailbox *, unsigned int));
int (*_lock) __P((struct _mailbox *, unsigned int));
int (*_lock) __P((struct _mailbox *, mailbox_lock_t));
char *(*_get_body) __P ((struct _mailbox *, unsigned int));
char *(*_get_header) __P ((struct _mailbox *, unsigned int));
}
......@@ -70,5 +74,3 @@ char *mbox_header_line __P ((mailbox *mbox, unsigned int num, const char *header
char *mbox_body_lines __P ((mailbox *mbox, unsigned int num, unsigned int lines));
#endif
......
......@@ -361,7 +361,7 @@ unixmbox_get_header (mailbox * mbox, unsigned int num)
* Get locking code from Procmail and/or Exim
*/
int
unixmbox_lock (mailbox *mbox, unsigned int mode)
unixmbox_lock (mailbox *mbox, mailbox_lock_t mode)
{
unixmbox_data *data = mbox->_data;
data->lockmode = mode;
......
......@@ -55,7 +55,7 @@ typedef struct _unixmbox_data
{
unixmbox_message *messages;
FILE *file;
int lockmode;
mailbox_lock_t lockmode;
}
unixmbox_data;
......@@ -65,7 +65,7 @@ int unixmbox_delete (mailbox *mbox, unsigned int num);
int unixmbox_undelete (mailbox *mbox, unsigned int num);
int unixmbox_expunge (mailbox *mbox);
int unixmbox_is_deleted (mailbox *mbox, unsigned int num);
int unixmbox_lock (mailbox *mbox, unsigned int mode);
int unixmbox_lock (mailbox *mbox, mailbox_lock_t mode);
int unixmbox_add_message (mailbox *mbox, char *message);
char *unixmbox_get_body (mailbox *mbox, unsigned int num);
char *unixmbox_get_header (mailbox *mbox, unsigned int num);
......