gtpc2m0hC/C++ Language Support User's Guide

attac_ext-Attach a Detached Working Storage Block

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

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.