gtpc2m7wC/C++ Language Support User's Guide

tpf_decb_create-Create a Data Event Control Block

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

Format

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

name
A pointer to a 16-byte user-specified DECB name. The name parameter is optional. If NULL is coded, a name is not assigned to the DECB.

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_DUPNAME if the name parameter specified contains a DECB name that already exists for this entry control block (ECB).

Programming Considerations

Examples

The following example creates 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_create(decb_name, &rc)) != NULL ); { /* DECB is successfully created */ } else { /* failed to create DECB, check rc for the reason */ }

Related Information

See TPF Application Programming for more information about DECBs.