[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3
From: |
Sergey Poznyakoff |
Subject: |
Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3 |
Date: |
Tue, 25 Feb 2003 12:14:21 +0200 |
Just an idea regarding object structures in the new libmailbox.
The mailutils objects have many things in common, so it may prove
useful to create a 'generic object' structure which will provide
the basic object functionality, e.g.:
typedef struct _mu_generic_object *mu_generic_object_t;
/* generic methods available to any object */
struct _mu_generic_vtab {
int (*create) (mu_generic_object_t *);
int (*close) (mu_generic_object_t);
int (*destroy)(mu_generic_object_t *);
int (*notify) (mu_generic_object obj, int event, void *data);
/* something else? */
};
/* generic object: a parent of all mailutils objects */
struct _mu_generic_object {
int type; /* Type of the object */
size_t size; /* Size of the object instance */
struct _mu_generic_vtab vtab; /* generic methods */
/* Possibly something else? */
};
Now, mailbox structure would be defined as follows:
typedef struct _mu_mailbox *mu_mailbox_t;
struct _mu_mailbox {
struct _mu_generic_object gen; /* This provides basic methods */
struct _mu_mailbox_vtab vtab; /* mailbox-specific methods */
/* Mailbox-specific data follow */
unsigned int messages_count;
/* ... etc ... */
};
Any particular mailbox implementation is built upon mu_mailbox_t in
the following way:
struct _mu_mbox_mailbox {
struct _mu_mailbox base; /* basic mailbox functionality*/
/* Mbox-specific data */
char *filename;
lockfile_t lockfile;
/* ... etc ... */
};
Opinions?
Regards,
Sergey
- [bug-mailutils] Mailutils 0.3 released, Sergey Poznyakoff, 2003/02/16
- Re: [bug-mailutils] Mailutils 0.3 released, Alain Magloire, 2003/02/17
- [bug-mailutils] Merging libraries (was Re: Mailutils 0.3 released), Sergey Poznyakoff, 2003/02/18
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3 released), Alain Magloire, 2003/02/18
- Message not available
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3 released), Sergey Poznyakoff, 2003/02/19
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3 released), Alain Magloire, 2003/02/19
- Message not available
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3 released), Sergey Poznyakoff, 2003/02/20
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3, Alain Magloire, 2003/02/20
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3, Alain Magloire, 2003/02/24
- Message not available
- Re: [bug-mailutils] Merging libraries, Sergey Poznyakoff, 2003/02/25
- Message not available
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3,
Sergey Poznyakoff <=
- Re: [bug-mailutils] Merging libraries (was Re: Mailutils 0.3, Alain Magloire, 2003/02/25