MQACH - API exit chain header

The MQACH structure describes the header information that must be present at the start of each exit chain area.

Any exit function can create a chain area in dynamically-obtained storage (for example, by using malloc), and add that area to the chain at the desired location (start, middle, or end). The exit function must ensure that it sets all fields in MQACH to valid values.

The exit suite which creates the chain area is responsible for destroying that chain area prior to termination (the  MQ_TERM_EXIT  function is a convenient point at which to do this). However, adding and removing chain areas from the chain must only be done by an exit function when it is invoked by the queue manager; this restriction is necessary to avoid serialization problems.

Exit chain areas are made available to all exit suites, and should not be used to hold private data. Use ExitUserArea in MQAXP to hold private data.

In general there is no correspondence between the chain of exit functions that are invoked for an API call, and the chain of exit chain areas:

This structure is supported in the following environments: AIX, HP-UX, Solaris, Linux, and Windows.

Fields

The MQACH structure contains the following fields:

StrucId (MQCHAR4)

Structure identifier.

The value is:

MQACH_STRUC_ID
Identifier for API exit chain header structure.

For the C programming language, the constant MQACH_STRUC_ID_ARRAY is also defined; this has the same value as MQACH_STRUC_ID, but is an array of characters instead of a string.

This initial value of this field is MQACH_STRUC_ID.

Version (MQLONG)

Structure version number.

The value is:

MQACH_VERSION_1
Version-1 API exit chain header structure.

The following constant specifies the version number of the current version:

MQACH_CURRENT_VERSION
Current version of API exit chain header structure.

Note:When a new version of the MQACH structure is introduced, the layout of the existing part is not changed. The exit function should therefore check that the version number is equal to or greater than the lowest version which contains the fields that the exit function needs to use.

The initial value of this field is MQACH_CURRENT_VERSION.

StrucLength (MQLONG)

Length of MQACH structure.

This is the length of the MQACH structure itself; this length excludes the exit-defined data that follows the MQACH structure (see the ChainAreaLength field).

The following value is defined:

MQACH_LENGTH_1
Length of version-1 MQACH structure.

The following constant specifies the length of the current version:

MQACH_CURRENT_LENGTH
Length of current version of exit chain area header.

The initial value of this field is MQACH_CURRENT_LENGTH.

ChainAreaLength (MQLONG)

Total length of chain area.

This is the total length of the chain area. It is equal to the sum of the length of the MQACH plus the length of the exit-defined data that follows the MQACH.

The initial value of this field is zero.

ExitInfoName (MQCHAR48)

Exit information name.

This is a name that is used to identify the exit suite to which the chain area belongs.

The length of this field is given by MQ_EXIT_INFO_NAME_LENGTH. The initial value of this field is the null string in C.

NextChainAreaPtr (PMQACH)

Address of next MQACH structure in chain.

This is the address of the next chain area in the chain. If the current chain area is the last one in the chain, NextChainAreaPtr is the null pointer.

The initial value of this field is the null pointer.

C declaration

typedef struct tagMQACH MQACH;
struct tagMQACH {
  MQCHAR4   StrucId;           /* Structure identifier */
  MQLONG    Version;           /* Structure version number */
  MQLONG    StrucLength;       /* Length of MQACH structure */
  MQLONG    ChainAreaLength;   /* Total length of chain area */
  MQCHAR48  ExitInfoName;      /* Exit information name */
  PMQACH    NextChainAreaPtr;  /* Address of next MQACH structure in
                                  chain */
};



© IBM Corporation 1994, 2002. All Rights Reserved