gtpc2mak | C/C++ Language Support User's Guide |
This function tests the conversation for a specified condition. The
results of the test are indicated in the return code.
Format
#include <tppc.h>
void tppc_test(unsigned int *resid,
struct tppc_return_codes *rcode,
enum t_test_test test);
- resid
- This is a pointer to a 4-byte field that contains the resource ID.
This resource ID must be the ID assigned on the initial ALLOCATE for this
conversation or one that was assigned by an incoming ATTACH.
- rcode
- This is a pointer to the structure tppc_return_codes, defined
in tppc.h, where the return code is to be placed.
- test
- This specifies the type of test to be performed. This argument must
belong to the enumeration type t_test_test, defined in
tppc.h. Use one of the following values:
- TEST_TEST_POSTED
- This value specifies to test whether the conversation was posted.
- TEST_TEST_RTSRCVD
- This value specifies to test whether the REQUEST_TO_SEND notification was
received from the remote transaction program.
Return Codes
The following tables contain a list of the primary and secondary return
codes that can be returned to the program that called the tppc_test
function. A complete list of the return codes and their definitions can
be found in Table 37 and Table 38.
Table 42. Return Codes for TEST=POSTED
Symbolic Name
| Primary Code
| Secondary Code
|
LU62RC_OK
| 0000
|
|
LU62RC_POSTED_DATA
| ....
| 00000000
|
LU62RC_POSTED_NOTDATA
| ....
| 00000001
|
LU62RC_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_TCBID
| ....
| 00000001
|
LU62RC_PK_BAD_CONVID
| ....
| 00000002
|
LU62RC_STATE_CHECK
| 0002
|
|
LU62RC_NOT_RCV_STATE
| ....
| 00000122
|
LU62RC_ALLOC_ERROR
| 0003
|
|
LU62RC_SECURITY_NOT_VALID
| ....
| 080F6051
|
LU62RC_TP_NOT_AVAIL_RETRY
| ....
| 084B6031
|
LU62RC_TP_NOT_AVAIL_NO_RETRY
| ....
| 084C0000
|
LU62RC_TPN_NOT_RECOGNIZED
| ....
| 10086021
|
LU62RC_PIP_NOT_SPECIFIED_CORRECTLY
| ....
| 10086032
|
LU62RC_CONV_TYPE_MISMATCH
| ....
| 10086034
|
LU62RC_SYNLVL_NOTSUPORT
| ....
| 10086041
|
LU62RC_DLLOC_ABEND_PGM
| 0006
|
|
LU62RC_DLLOC_ABEND_SVC
| 0007
|
|
LU62RC_DLLOC_ABEND_TMR
| 0008
|
|
LU62RC_DLLOC_NORMAL
| 0009
|
|
LU62RC_POSTING_NOTACTIV
| 000B
|
|
LU62RC_PGMERR_NOTRUNC
| 000C
|
|
LU62RC_PGMERR_TRUNC
| 000D
|
|
LU62RC_PGMERR_PURGING
| 000E
|
|
LU62RC_CONVFAIL_RETRY
| 000F
|
|
LU62RC_CONVFAIL_NORETRY
| 0010
|
|
LU62RC_SVCERR_NOTRUNC
| 0011
|
|
LU62RC_SVCERR_TRUNC
| 0012
|
|
LU62RC_SVCERR_PURGING
| 0013
|
|
LU62RC_LLRCV_UNSUCESFUL
| 0014
|
|
LU62RC_TPF_ABEND
| FFFF
|
|
Table 43. Return Codes for TEST=RTSRCVD
Symbolic Name
| Primary Code
| Secondary Code
|
LU62RC_OK
| 0000
|
|
LU62RC_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_TCBID
| ....
| 00000001
|
LU62RC_PK_BAD_CONVID
| ....
| 00000002
|
LU62RC_LLRCV_UNSUCESFUL
| 0014
|
|
LU62RC_TPF_ABEND
| FFFF
|
|
Table 44. Return code when TEST is neither POSTED nor RTSRCVD
Symbolic name
| Primary Code
| Secondary Code
|
LU62RC_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_OPTION
| ....
| 00C62074
|
Programming Considerations
- The conversation must be in one of the following states, depending on the
type of test requested:
- Type
- State Required
- POSTED
- receive
- RTSTRCVD
- send or receive.
- The value supplied in resid must be the resource ID returned by
the tppc_allocate function or one that was assigned by an incoming
ATTACH.
- The test=TEST_TEST_POSTED option is valid only when the
conversation is in receive state.
- The test=TEST_TEST_POSTED option is used in conjunction with the
tppc_post_on_receipt function. The use of
tppc_post_on_receipt and tppc_test allows a program to
continue its processing while waiting for information to become
available. The TPF transaction program calls
tppc_post_on_receipt for one or more conversations and then calls
tppc_test for each conversation to determine when information is
available to be received.
- For the test=TEST_TEST_POSTED option, the return code indicates
whether posting is active, whether the conversation was posted, and whether
the information available is data or not. The TPF transaction program
must call tppc_receive to receive the information for a
conversation that was posted.
- The test=TEST_TEST_POSTED option returns LU62RC_LLRCV_UNSUCESFUL
if the conversation was not posted.
- Posting is active for a conversation on which the
tppc_post_on_receipt function was called and posting was not reset
or canceled. See tppc_post_on_receipt-Set Posting Active for a Conversation for more information on posting.
- The test=TEST_TEST_RTSRVCD option returns LU62RC_OK if the
REQUEST_TO_SEND was received. Otherwise, the REQUEST_TO_SEND indication
was not received from the remote transaction program and,
LU62RC_LLRCV_UNSUCESFUL is returned.
- To enter receive state, the local transaction program must call
the appropriate function, such as tppc_receive or
tppc_prepare_to_receive, when the REQUEST_TO_SEND indication is
received.
- See Programming Considerations for Basic Conversation Functions for additional programming considerations relating to the
TPF/APPC basic conversation functions.
Examples
The following example tests if a conversation was posted.
#include <tppc.h>
unsigned int resource_id;
struct tppc_return_codes return_code;
·
·
·
/* set up resource_id with the value returned from the allocate verb */
·
·
·
tppc_test(&resource_id,&return_code,TEST_TEST_POSTED);
/* normal processing path */
·
·
·
Related Information