|
|
The most important file for the author of an application using the C client interface is the mail.h header. mail.h defines several important data structures which are passed between the main program and the C client. Although some functions (for example, mail_fetchtext_body) return the actual data, for certain other data items (for example, flags) you need to get the data as a structure reference. mail.h also defines a large number of useful constants and structures.
When a function in mail.h exists to reference data, it must be used instead of referencing the structures directly. This is because in some cases the data is not actually fetched until a reference (via the function call) is made. For example, although the MESSAGECACHE element for a message can be obtained by indexing the proper cache element in the stream, there is no guarantee that the item in fact exists unless mail_fetchstructure_full is called for that message. There are less costly functions for creating and loading a MESSAGECACHE element.