gtpc2m7cC/C++ Language Support User's Guide

tape_read-Read a Record From General Tape

This function reads a record from a general tape.

Format

#include   <tpftape.h>
void       *tape_read(const char *name, enum t_lvl level,
                      enum t_blktype size);

name
This argument is a pointer to type char, which must be a three-character string identifying the tape to be read from. This function can only be called for a general tape.

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 identifies the CBRW on which the working storage block containing the tape record image will be placed.

size
One of 4 possible values (L0, L1, L2, L4) from the enumeration type t_blktype, representing the working storage block size of the record on tape:

L0
127 bytes

L1
381 bytes

L2
1055 bytes

L4
4095 bytes.

Normal Return

Pointer to the working storage block containing the tape record image.

Error Return

NULL.

Programming Considerations

Examples

The following example opens, reads a record from, and closes a VPH tape mounted for input.

#include <tpftape.h>
struct vp0vp *vp;

  ·
  ·
  ·
tape_open("VPH",INPUT); if((vp = (struct vp0vp *) tape_read("VPH",D6,L2)) == NULL) exit(0x56789); /* Dump & exit if read failed */ tape_close("VPH"); /* Close it. */

Related Information