A CMC_extension structure contains a CMC data extension for use by the CMC API functions and data structures. A CMC data extension adds parameters to functions or members to data structures.
Header file: | XCMC.H |
typedef struct {
CMC_uint32 item_code;
CMC_uint32 item_data;
CMC_buffer item_reference;
CMC_flags extension_flags;
} CMC_extension;
These extensions are identified by the extension identifiers CMC_XS_COM and CMC_XS_MS. For definitions of these extensions, see Data Extensions.
Extensions are used to add functionality to the CMC API. For example, a client application can implement the cmc_act_on function to allow saving a partially completed message in the receive folder (the Inbox) for later updating and sending. To pass the structure defining this partially completed message to CMC and receive back the resulting message reference, the client application can use the CMC_X_COM_SAVE_MESSAGE extension.
An extension can be either an input extension or an output extension; that is, it can be passed either as input from a client application to CMC or as output from CMC to a client application. Whether the information contained in an extension is input or output is implied by the semantics of the particular extension in question and by the presence or absence of CMC_EXT_OUTPUT in the extension's extension_flags member after a call to a CMC function. For input extensions, the client application in question allocates memory for the extension structure and any other structures associated with the extension. For output extensions, storage for the extension result, if necessary, is allocated by a CMC function.
For output extensions, a client application must free storage allocated by CMC with calls to the cmc_free function. For each CMC_extension structure in the array, the caller must call cmc_free for the pointer in the item_reference member of the structure.
CMC does not require explicit release of a data extension structure, because CMC releases such structures along with the structures that contain them. For example, CMC implicitly releases the message extension array created by the cmc_read function when calling cmc_free for the enclosing CMC_message structure.
cmc_act_on, cmc_free, CMC_message, cmc_read