gtpc2m11 | C/C++ Language Support User's Guide |
This function searches the CRAS status table.
Format
#include <tpfapi.h> long int cratc(unsigned long type, struct cratc_iparms *cratc_input, struct cratc_slot **addr_crat_slot_ptr);
WTOPC_AUDT
WTOPC_COMM
WTOPC_DASD
WTOPC_PRC
WTOPC_RDBS
WTOPC_RO
WTOPC_TAPE
If the CPU ID is omitted, you must zero out the CPU ID field in the input structure and the CPU ID will default to that of the ECB (CE1CPD).
Normal Return
A nonzero long integer. When this value is converted to hexadecimal format, it is equivalent to the concatenation of the 3 bytes of the LNIATA number (also in hex) with the last byte of the EBCDIC CPU ID (converted to hex) of the located CRAS terminal. The return code integer can also be equated to the integer value in the cratc_oparms structure. Because this structure is a union, the integer can then be addressed in character format.
The CRAS table slot address will be stored in the location pointed to by the addr_crat_slot_ptr parameter.
Error Return
A value of 0. This indicates that the requested information
could not be located in the CRAS table.
Programming Considerations
None.
Examples
The following example does a CRATC_VERIFY on LNIATA 010000 for CPU B.
#include <tpfeq.h> #include <tpfio.h> #include <tpfapi.h> #include <string.h> #include <stdio.h>
·
·
·
struct cratc_slot * crat_slot_ptr; struct cratc_iparms cratc_input; struct cratc_oparms cratc_output; unsigned long int rc; unsigned char lniata[3] = {01,00,00}; unsigned char cpuid = 'B';
·
·
·
memset(&cratc_input,0x00,sizeof(struct cratc_iparms)); memcpy(cratc_input.cr_in.cratc_i_lniata,lniata,3); memcpy(&cratc_input.cratc_i_cpuid,&cpuid,1); rc = cratc(CRATC_VERIFY, &cratc_input, &crat_slot_ptr); if (rc) { cratc_output.cr_out.cratc_o_return = rc; }
·
·
·
exit(0); }
The following example does a CRATC_LOCATE for the PRC routing code for CPU B.
#include <tpfeq.h> #include <tpfio.h> #include <tpfapi.h> #include <string.h> #include <stdio.h>
·
·
·
struct cratc_slot * crat_slot_ptr; struct cratc_iparms cratc_input; struct cratc_oparms cratc_output; unsigned long int rc; unsigned char cpuid = 'B'; short int routecd = WTOPC_PRC;
·
·
·
memset(&cratc_input,0x00,sizeof(struct cratc_iparms)); memcpy(&cratc_input.cr_in.cratc_i_rtcd[1],&routecd,2); memcpy(&cratc_input.cratc_i_cpuid,&cpuid,1); rc = cratc(CRATC_LOCATE, &cratc_input, &crat_slot_ptr); if (rc) { cratc_output.cr_out.cratc_o_return = rc; }
·
·
·
exit(0); }
The following example does a CRATC_FSC with the CRAS table index 3.
#include <tpfeq.h> #include <tpfio.h> #include <tpfapi.h> #include <string.h> #include <stdio.h>
·
·
·
struct cratc_slot * crat_slot_ptr; struct cratc_iparms cratc_input; struct cratc_oparms cratc_output; unsigned long int rc; unsigned char index = 3;
·
·
·
memset(&cratc_input,0x00,sizeof(struct cratc_iparms)); memcpy(&cratc_input.cr_in.cratc_i_rtcd[0],&index,1); rc = cratc(CRATC_FSC, &cratc_input, &crat_slot_ptr); if (rc) { cratc_output.cr_out.cratc_o_return = rc; }
·
·
·
exit(0); }
Related Information