Re: RFC mailbox interface



Hi Pawel,

On 2001.11.17 10:55 Pawel Salek wrote:
> 
> On 2001.11.17 06:58 Kenneth Haley wrote:
>> After following this thread I came up with the following interface.
>> 
>> typedef struct _Message {
>> 	struct _Folder *Folder;
>> 	Flags flags;
>> 	//perhaps return a string instead?
>> 	glist (*getHeaders)(const char[] hdrs);
>> 	glist (*getAllHeaders)();
>> 	char* (*getBody)();
>> 	char* (*getAll)();
>> };
> 
> Are these methods not specific to the mailbox that owns the Message?
> I imagine that following scheme would be a better solution:
> glist
> lib_message_getHeaders(Message* msg)
> { msg->folder->getHeaders(msg->folder, msg); }

Yes, right. That was in my original proposal, as a matter of fact, except 
that I had separated the function pointers from the mailbox struct 
initially, putting them into a mailboxTYPE struct that was referenced by 
the mailbox struct. That way, they only need to be set up once, not copied 
each time.
There's no point in hving to drag along these pointers with each message.

Melanie



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]