gtpc2mb3 | C/C++ Language Support User's Guide |
This function sets the deallocate_type characteristic. It
overrides the default value set by the cminit or cmaccp
function.
Format
#include <tpfmap.h>
void cmsdt(unsigned char *conversation_ID,
signed int *deallocate_type,
signed int *return_code);
- conversation_ID
- This is a pointer to an 8-byte character array that contains the
conversation ID. This conversation ID must be the ID returned by the
cminit (INITIALIZE) or cmaccp (ACCEPT_CONVERSATION) that
started this conversation.
- deallocate_type
- This is a pointer to a 4-byte field that specifies the type of
deallocation to be done when the program issues a cmdeal
function. Use one of the following values:
- CM_DEALLOCATE_SYNC_LEVEL
- This value specifies that the sync_level characteristic should
be used to determine the type of deallocate. If sync_level
is CM_NONE, the function executes a cmflus and then
deallocates the conversation normally. If sync_level is
CM_CONFIRM, the function executes a cmcfm. If the
CONFIRM is successful, the conversation is deallocated normally. If the
CONFIRM fails, the return code determines the state of the
conversation.
- CM_DEALLOCATE_FLUSH
- This value specifies to do a cmflus function and then
deallocate the conversation normally.
- CM_DEALLOCATE_CONFIRM
- This value specifies to do a cmcfm function. If the
CONFIRM is successful, the conversation is deallocated normally. If the
CONFIRM fails, the return code determines the state of the
conversation.
- CM_DEALLOCATE_ABEND
- This value specifies that the conversation should be unconditionally and
abnormally deallocated. If the conversation is in send
state, the function executes a cmflus. If the conversation
is in receive state, data may be purged.
- return_code
- This is a pointer to a 4-byte field where the return code is to be
placed.
Return Codes
The following is a list of return codes that can be returned to the program
that called the cmsdt function. A complete list of the
return codes and their definitions can be found in Table 45.
- CM_OK
- CM_PRODUCT_SPECIFIC_ERROR
- CM_PROGRAM_PARAMETER_CHECK -- This indicates one of the
following:
- The specified conversation_ID is invalid.
- The specified deallocate_type is invalid.
- The sync_level characteristic is CM_NONE, and
deallocate_type is CM_DEALLOCATE_CONFIRM.
Programming Considerations
- You can execute this function on any I-stream.
- The conversation can be in any state.
- The value supplied in conversation_ID must be the conversation ID
returned by the cmaccp or cminit function.
- This function changes the value of the deallocate_type
characteristic. The sync_level characteristic can also
determine the type of deallocation to be performed.
- Use CM_DEALLOCATE_SYNC_LEVEL when the desired type of deallocate
should change depending on the sync_level characteristic.
- Use CM_DEALLOCATE_ABEND when a conversation should be
unconditionally deallocated regardless of its synchronization level and
state.
- This function causes no state change.
- If return_code is not CM_OK, then the deallocate_type
characteristic remains unchanged.
Examples
The following example changes the deallocate_type
characteristic.
#include <tpfmap.h>
unsigned char convid[8];
signed int type;
signed int rcode;
.
.
/* set conversation_ID with value returned from accept or initialize */
.
.
cmsdt(convid,&type,&rcode);
. /* normal processing path */
.
.
Related Information