c_tpclos - Closes a tape device

SYNTAX

#include "tapeio.h"

FUNCTION c_tpclos (unit, mode, rewopt, eofopt)

     long     *unit;
     long     *mode;
     long     *rewopt;
     long     *eofopt;

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.

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.

rewopt (input, integer)

A value of NOREW (0) specifies norewind; REWIND (1) specifies to rewind the tape before closing it. REWOFFL (2) specifies that the tape drive is to be rewound and taken off-line after closing.

eofopt (input, integer)

Number of tape EOF marks to be written on close of a write to the device. The values 0, 1, 2 or 3 are valid for this parameter. This parameter is ignored when reading.

DESCRIPTION

The c_tpclos() call is used to close a tape device.

RETURN VALUE

c_tpclos() returns

     TAPE_SUCC (0) -->  successful completion
     TPCLOS_OPT  -->  no such option
     TPCLOS_WEOF -->  error writing eof
     TPCLOS_CLOS -->  device error
     TPCLOS_REW  -->  rewind error