gtpc2m97 | C/C++ Language Support User's Guide |
The function transfers the information from a requested CBRW to a specified
8-byte field and detaches the storage block associated with the CBRW.
If the field specified is in global storage, the global function is used to
update the field. Once a block has been unhooked, any other
ECB can rehook the same block by using this function.
Format
#include <tpfapi.h>
void unhka(enum t_lvl level, enum t_hook_type glob_indicator, ...);
- level
- One of 16 possible values representing a valid data level from the
enumeration type t_lvl, expressed as Dx, where x represents
the hexadecimal number of the level (0-F). This argument
represents the CBRW from where information is to be transferred from.
- glob_indicator
- This argument must belong to the enumeration type t_hook_type specifying
one of two possible values:
- UNHKA_GLOBAL
- Specifies that the save area is in protected storage.
- UNHKA_UNPROTECTED
- Specifies that the save area is not in protected storage.
- ...
- This argument is either an address if the 8-byte save area is not in
protected storage or a global tag if the field is in protected storage.
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
- The location of the last parameter will contain the contents of the CBRW
specified by CE1CR(literal).
- The use of this function must be limited to those functions having unique
buffering requirements. It should not be used to obtain an additional
data level.
- Any application function using the unhka-rehka facility must be designed
so that 2 successive unhka functions referencing a given field are always
separated by a rehka function referencing the field.
- unhka may use the global function.
- If the save area supplied is a synchronizable global field that needs to
be locked before modified, then it becomes the users responsibility to call
the global function with the GLOBAL_LOCK, GLOBAL_UNLOCK or GLOBAL_SYNC option,
appropriately.
- If an incorrect parameter is given, a system error with exit
occurs.
Examples
The following example unhooks a core block from level 0 to a location
pointed to by save_ptr.
#include <tpfapi.h>
·
·
·
char save_area[8];
·
·
·
unhka(D0, UNHKA_UNPROTECTED, save_area);
·
·
·
The following example unhooks a core block from level 0 to a location
specified by the global tag _s3hok.
#include <tpfapi.h>
·
·
·
unhka(D0, UNHKA_PROTECTED, _s3hok);
·
·
·
Related Information
rehka-Rehook Core Block.