gtpc2m7xC/C++ Language Support User's Guide

tpf_decb_locate-Locate a Data Event Control Block

This function provides interfaces to locate a data event control block (DECB).

Format

#include  <c$decb.h>
TPF_DECB  *tpf_decb_locate(char *name, DECBC_RC *rc);
 

or

#include  <c$decb.h>
TPF_DECB  *tpf_decb_locate(TPF_DECB *decb, DECBC_CHAIN chain, DECBC_RC *rc);

name
A pointer to a 16-byte user-specified DECB name. The DECB name was previously specified using the tpf_decb_create function.

decb
A pointer to the current DECB. If NULL is specified, the first DECB, as specified by the chain parameter, will be returned.

chain
Indicates whether an active DECB or any DECB will be returned and is one of the following:

DECBC_CHAIN_INUSE
Indicates the next active DECB after the current DECB will be returned.

DECBC_CHAIN_ANY
Indicates the next DECB, active or inactive, after the current DECB will be returned.

rc
A pointer to the return code. rc is an optional parameter and, if NULL is coded, the return code will not be set.

Normal Return

A pointer to a DECB and the return code is set to DECBC_OK.

Error Return

A NULL pointer and rc contains DECBC_NOTFOUND if the name parameter specified contains a DECB name that is not valid for this entry control block (ECB).

Programming Considerations

Examples

The following example locates a DECB with a given name.

#include <c$decb.h>

·
·
·
DECBC_RC rc; TPF_DECB *decb; char decb_name[16] = "APPLWXY";
·
·
·
if ( (decb = tpf_decb_locate(decb_name, &rc)) != NULL ); { /* DECB is successfully located */ }else { /* failed to locate DECB, check rc for the reason */ }

Related Information

See TPF Application Programming for more information about DECBs.