gtpc2m4g | C/C++ Language Support User's Guide |
This function tests the indicated core block reference word (CBRW) data level or data event control block (DECB) for the existence of a working storage block.
Format
#include <tpfapi.h> int levtest(enum t_lvl level);
or
#include <tpfapi.h> int levtest(TPF_DECB *decb);
Normal Return
An integer value representing the size of the working storage block in bytes if the ECB data level or DECB is occupied, or zero if the ECB data level or DECB is unoccupied.
Error Return
Not applicable.
Programming Considerations
Examples
The following example obtains and addresses a working storage block on ECB data level DC if it is unoccupied, or simply addresses the existing block if occupied.
#include <tpfapi.h> char *work;
·
·
·
if(!levtest(DC)) work = getcc(DC, TYPE, L2); else work = ecbptr()->ce1crc;
The following example obtains the address of a working storage block on an unoccupied DECB.
#include <tpfapi.h> char *work; TPF_DECB *decb
·
·
·
if(!levtest(decb)) work = (char *)getcc(decb, GETCC_TYPE, L2);
Related Information
See TPF Application Programming for more information about DECBs.