gtpc2mitC/C++ Language Support User's Guide

TPFxd_readBlock-Read into a Core Block from an External Device

This function is used to read core block images from the external device.

Format

#include <c$tpxd.h>
long TPFxd_readBlock (TPFxd_extToken  *token,
                      enum t_lvl      level,
                      enum t_blktype  coreBlockType);

token
The returned token from the TPFxd_archiveStart or TPFxd_open request.

level
One of 16 possible values representing a valid data level from enumeration type t_lvl, expressed as Dx, where x represents the hexadecimal number of the level (0-F). This parameter identifies the data level where the block will be placed.

coreBlockType
The core block type to use for the read.

Normal Return

A return code of 1 indicates a normal return.

Error Return

An error return is indicated by a negative return code. For a list of error codes applicable to this function, see Error Codes.

Programming Considerations

Examples

The following example reads the first record from the position indicated into data level DF.

#include <c$tpxd.h>
long example(TPFxd_locationMap wherefirst)
{
TPFxd_extToken    *token;
enum              tpxd_mode mode;
long              howbigitis;
long              howlongtowait;
char              *message;
long              returncode;
 
howlongtowait = 60;
howbigitis = 32000;
message = NULL;
token = NULL;
mode = RD;
TPFxd_open (&token,
            &wherefirst,
            howbigitis,
            howlongtowait,
            message,
            mode );
malloc (whatWasRead,howbigitis);
returncode = TPFxd_readBlock(token,DF,L4);
printf("readBlock return code is %i\n",returncode);

  ·
  ·
  ·
}

Related Information