gtpc2m0iC/C++ Language Support User's Guide

attac_id-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_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);

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 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.

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

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.