gtpc2m7w | C/C++ Language Support User's Guide |
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
- The DECB is an alternative to standard ECB data level information, which
is used to specify information about I/O request core block reference word
(CBRW) and file address reference word (FARW) fields. The DECB fields
specify the same CBRW and FARW information without requiring the use of an ECB
data level. All the same requirements and conditions that apply to the
CBRW and FARW in the ECB also pertain to the same field information in the
DECB.
- The FARW in the DECB provides storage for an 8-byte file address.
- Functions that support the use of a DECB (such as
file_record_ext, find_record_ext, and so on) will only
accept a DECB address as a valid reference to a DECB. If an application
does not maintain the address of a particular DECB and instead maintains the
name of the DECB, the caller will first have to issue the
tpf_decb_locate function to obtain the address of the desired
DECB. The resulting DECB address may then be passed on the subsequent
function call.
- Applications that use DECBs must be compiled with the C++ compiler.
- The letters I, i, TPF, TPF_, tpf, and tpf_ are reserved for future use by
IBM for DECB name spaces.
- This function is implemented in dynamic link library (DLL)
CTAD. You must use the definition side-deck for DLL CTAD to link-edit
an application that uses this function.
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.