gtpc2maz | C/C++ Language Support User's Guide |
This function allocates local resources for a conversation and initializes
various characteristics before the ALLOCATE is done. The remote partner
uses the cmaccp function (ACCEPT_CONVERSATION) to initialize the
conversation on its end.
Format
#include <tpfmap.h>
void cminit (unsigned char *conversation_ID,
unsigned char *sym_dest_name,
signed int *return_code);
- conversation_ID
- This is a pointer to an 8-byte character array where the conversation ID
is returned. You must specify this conversation ID on all subsequent
functions for this conversation.
- sym_dest_name
- This is a pointer to an 8-character string, which specifies the symbolic
destination name. This symbolic name is used to determine the remote
transaction program name, partner LU name, and mode name for the session that
is to carry the conversation. The side information table is searched
for the symbolic name and the following characteristics are set from the
entry:
- partner_LU_name
- partner_LU_name_length
- mode_name
- mode_name_length
- TP_name
- TP_name_length.
If the symbolic name is less than 8 characters, it is left-justified and
padded to the right with blanks. If the string contains all blanks, the
side information table is not searched and the characteristics listed
previously are not set. In this case, the program is expected to set
the characteristics with the set functions before doing the cmallc
function.
- Note:
- See the TPF ACF/SNA Data Communications Reference
for more information about the side information table. See TPF Operations for more information about the ZNSID
command.
- 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 cminit 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 -- The specified sym_dest_name
could not be found.
Programming Considerations
- You can execute this function on any I-stream.
- This must be the first function called for any conversation initiated by
the program.
- The value returned to conversation_ID must be used on all other
TPF/APPC mapped functions called for this conversation.
- There are no characteristics that modify this function.
- The following characteristics are initialized to match the values in the
side information table:
- mode_name
- mode_name_length
- partner_LU_name
- partner_LU_name_length
- TP_name
- TP_name_length.
- The following characteristics are always initialized as follows:
- conversation_type is set to
CM_MAPPED_CONVERSATION.
- deallocate_type is set to
CM_DEALLOCATE_SYNC_LEVEL.
- error_direction is set to CM_RECEIVE_ERROR.
- prepare_to_receive_type is set to
CM_PREP_TO_RECEIVE_SYNC_LEVEL.
- return_control is set to
CM_WHEN_SESSION_ALLOCATED.
- send_type is set to CM_BUFFER_DATA.
- sync_level is set to CM_NONE.
- If the return_code is CM_OK, the conversation enters
initialize state.
- The cminit function can be called more than once in order to
have multiple conversations. The conversation_ID returned is
always different.
- You can use the SET functions to change the values of the characteristics
before the ALLOCATE.
Examples
The following example initializes a conversation.
#include <tpfmap.h>
unsigned char convid[8];
unsigned char name[8];
signed int rcode;
.
.
/* set conversation_ID with value returned from accept or initialize */
.
.
cminit(convid,name,&rcode);
. /* normal processing path */
.
.
Related Information