c_tpbsr - Backspaces over (count) records on tape

SYNTAX

#include "tapeio.h"

FUNCTION c_tpbsr (unit, count, mode)

     long     *unit;
     long     *count;
     long     *mode;

PARAMETERS

unit (input, integer)

Unit number to be used as a reference for the drive. This number is set by c_tpopen() and should not be altered.

count (input/output, integer)

Number of records to back over. If beginning of file is encountered before all records are skipped, c_tpbsr() returns TAPE_BOF and count returns the number of records skipped. The tape will be left at the beginning of the current file.

mode (input, integer)

A value of NO_HANDLE (0) specifies that errors are to be returned to the calling program. A value of HANDLE (1) specifies that when an error occurs the routine is to return an error to the calling program and display a message to the terminal.

DESCRIPTION

The c_tpbsr() call is used to back over count records on a tape device. However, it will not backspace over an EOF mark. Some examples of c_tpbsr() follow:

        
     Tape location before,              Tape location after call,
     called with count = 1              returns TAPE_SUCC, count = 1
              |                            |
              V                            V
  ------------------------------     ------------------------------
  |   |E|   |E|    |E|     |E|E|     |   |E|   |E|    |E|     |E|E|
  |   |O|   |O|    |O|     |O|O|     |   |O|   |O|    |O|     |O|O|
  |   |R|   |R|    |R|     |F|F|     |   |R|   |R|    |R|     |F|F|
  ------------------------------     ------------------------------

     Tape location before,              Tape location after call,
     called with count = 2              returns TAPE_BOT, count = 2
              |                      |
              V                      V
  ------------------------------     ------------------------------
  |   |E|   |E|    |E|     |E|E|     |   |E|   |E|    |E|     |E|E|
  |   |O|   |O|    |O|     |O|O|     |   |O|   |O|    |O|     |O|O|
  |   |R|   |R|    |R|     |F|F|     |   |R|   |R|    |R|     |F|F|
  ------------------------------     ------------------------------

RETURN VALUE

c_tpbsr() returns

     TAPE_SUCC (0) -->  successful completion
     TAPE_BOF  -->  beginning of file
     TPBSR_BSR -->  device error
     TAPE_BOT  -->  beginning of tape