Obtain integer-valued information relating to the current message part.
int mtaDecodeMessageInfoInt(mta_decode_t *dctx, int item); |
Arguments |
Description |
---|---|
dctx |
A decode context created by mtaMessageDecode(). |
item |
Item identifier specifying which value to return. See the description that follows for the list of permitted values for this argument. |
This routine is used to obtain integer-valued information about the current message part. (When mtaDecodeMessage() calls either a user-supplied inspection or output routine, it provides a decode context describing the current message part being processed.)
The following table lists the values for the item argument, and gives a description of each.
Values |
Description |
---|---|
MTA_DECODE_DTYPE |
Data type associated with this part. The returned values will be MTA_DATA_NONE, MTA_DATA_HEADER, MTA_DATA_TEXT, or MTA_DATA_BINARY. |
MTA_DECODE_PART_NUMBER |
Sequential part number for the current part. The first message part is part 0, the second part is 1, the third part is 2, and so on. |
Upon normal, successful completion the value of the requested item is returned. In the event of an error, a value of -1 is returned and mta_errno is set to indicate the error status code. The following table lists the error status codes for this routine, and gives an example of each.
Error Status Codes |
Description |
---|---|
MTA_BADARGS |
A NULL value was supplied for the dctx call argument. |
MTA_NOSUCHITEM |
An invalid value was supplied for the item call argument. |
part_number = mtaDecodeMessageInfoInt(dctx, MTA_PART_NUMBER);