gtpc2m0i | 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_id function.
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_id function call to contain the same FARW contents as when the block was detached through the detac_id function call.
Format
#include <tpfapi.h> void *attac_id(enum t_lvl level);
or
#include <tpfapi.h> void *attac_id(TPF_DECB *decb);
Normal Return
Void. The pointer of type void represents the address of the start of the newly attached block.
Error Return
Not applicable.
Programming Considerations
When you code 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.
Examples
The following example reattaches a previously detached IM0IM record to level D6.
#include <tpfapi.h> struct im0im *inm;
·
·
·
inm = (struct im0im *)attac_id(D6);
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_id(decb);
Related Information
See TPF Application Programming for more information about DECBs.