Re: single_fields
DINH Viêt Hoà <[email protected]>
| Newsgroups | gmane.mail.libetpan.user |
|---|---|
| Message-ID | <[email protected]> |
On Feb 15, 2004, at 3:08 PM, Zsolt VARGA wrote:
>
> Hi,
>
> You have mentioned earlier that it's not good to use the single_fields
> /
> resolve_single_fields stuff. but having folder lists using the
> mailimf_fields_parse and printing the necessary stuffs like
> from,subject,size, has_attachment, and friends is a nightmare.
>
> meanwhile all of your tests, and etpans seems using single_fields
> heavily.
>
> what's the best to make a simple mailbox listing then ?
What single_fields / resolve_single_fields allows you is to build a
structure with a O(1) access, when you want to access quickly a
given data.
Instead of running through all the list of fields to match the
wanted field.
It is not advised to use the single_fields field in mailmessage
structure but you may use mailimf_single_fields_init() to initialize
a mailimf_single_fields structure.
void mailimf_single_fields_init(struct mailimf_single_fields *
single_fields, struct mailimf_fields * fields);
example :
void foo(struct mailimf_fields * fields)
{
struct mailimf_single_fields single_fields;
mailimf_single_fields_init(&single_fields, fields);
/* read single_fields structure and display information
or access information */
}
--
DINH Viet Hoa
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click