gtpc2m0h | C/C++ Language Support User's Guide |
This function reattaches a working storage block to an entry control block
(ECB) data level or data event control block (DECB). The ECB must not
be holding a storage block on the specified ECB data level or DECB; it
must have been previously released using the detac_ext
function.
Format
#include <tpfapi.h>
void *attac_ext(enum t_lvl level, int ext);
or
#include <tpfapi.h>
void *attac_ext(TPF_DECB *decb, int ext);
- level
- One of 16 possible values representing a valid ECB data level from
enumeration type t_lvl, expressed as Dx, where x
represents the hexadecimal number of the ECB data level (0-F).
The working storage block on this core block reference word (CBRW) level is
the block to be attached.
- decb
- A pointer to a DECB.
- ext
- Use one of following choices to indicate which block is to be
attached.
- ATTAC_USER_DEFAULT
- Indicates the user is unspecified, which implies that the last block
detached from this ECB data level should now be attached.
- ATTAC_USER_ACPDB
- Indicates the user is ACPDB, which implies that the block to be attached
is the previously detached block that has a matching file address reference
word (FARW) key. The caller of this function must set up the FARW for
the ECB data level or DECB specified in the attac_ext function call
to contain the same FARW contents as when the block was detached through the
detac_ext function call. The service routine will attach the
block that has a matching key; the key is the contents of the FARW for
the specified ECB data level or DECB.
Normal Return
Pointer of type void representing the address of the start of
the newly attached block.
Error Return
Not applicable.
Programming Considerations
- A system error with exit results if an incorrect ECB data level or DECB is
specified, or if no storage block was previously detached on the referenced
ECB data level or DECB.
- Excessive use of this function can cause a depletion of working
storage; therefore, its use should be carefully monitored.
- The detach functions (detac, detac_ext, and
detac_id) and the attach functions (attac,
attac_ext, and attac_id) push and
pop working storage blocks to and from a list chained from the
ECB. The attac function always attaches the block most
recently detached from the specified data level. The
attac_ext function attaches different blocks depending on how it is
coded. The attac_id function attaches a working storage
block with a matching FARW field to an ECB.
When coding attach and detach function calls, use the attac and
detac function calls together, or the attac_ext and
detac_ext function calls together, or the attac_id and
detac_id function calls together.
- The specified ECB data level or DECB CBRW, FARW, and FARW extension are
restored to the contents at the time the most recent detac or
detac_ext function was called for that ECB data level or
DECB.
- 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 reattaches a previously detached IM0IM record to
level D6.
#include <tpfapi.h>
struct im0im *inm;
·
·
·
inm = (struct im0im *)attac_ext(D6,ATTAC_USER_ACPDB);
The following example reattaches a previously detached IM0IM record to the
DECB referenced by variable decb.
#include <tpfapi.h>
struct im0im *inm;
TPF_DECB *decb;
·
·
·
inm = (struct im0im *)attac_ext(decb,ATTAC_USER_ACPDB);
Related Information
See TPF Application Programming for more
information about DECBs.