2 MTX -- SCSI Tape Attached Medium Changer Control Program
4 Copyright 1997-1998 Leonard N. Zubkoff <lnz@dandelion.com>
5 This file created by Eric Lee Green <eric@estinc.com>
7 This program is free software; you may redistribute and/or modify it under
8 the terms of the GNU General Public License Version 2 as published by the
9 Free Software Foundation.
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 $Date: 2001/06/19 21:51:32 $
20 /* Much of the guts of mtx.c has been extracted to mtxl.c, a library file
21 * full of utility routines. This file is the header file for that library.
30 void FatalError(char *ErrorMessage, ...);
31 void *xmalloc(size_t Size);
32 void *xzmalloc(size_t Size);
33 void slow_bzero(char *buffer, int numchars);
35 DEVICE_TYPE SCSI_OpenDevice(char *DeviceName);
36 void SCSI_CloseDevice(char *DeviceName, DEVICE_TYPE DeviceFD);
37 int SCSI_ExecuteCommand(DEVICE_TYPE DeviceFD,
38 Direction_T Direction,
43 RequestSense_T *RequestSense);
45 void PrintRequestSense(RequestSense_T *RequestSense);
47 int BigEndian16(unsigned char *BigEndianData);
48 int BigEndian24(unsigned char *BigEndianData);
49 int min(int x, int y);
50 int max(int x, int y);
52 ElementStatus_T *ReadElementStatus(DEVICE_TYPE MediumChangerFD, RequestSense_T *RequestSense, Inquiry_T *inquiry_info, SCSI_Flags_T *flags);
54 Inquiry_T *RequestInquiry(DEVICE_TYPE fd, RequestSense_T *RequestSense);
56 RequestSense_T *MoveMedium(DEVICE_TYPE MediumChangerFD, int SourceAddress,
57 int DestinationAddress,
58 ElementStatus_T *ElementStatus,
59 Inquiry_T *inquiry_info, SCSI_Flags_T *flags);
61 int Inventory(DEVICE_TYPE MediumChangerFD); /* inventory library */
62 int Eject(DEVICE_TYPE fd); /* unload tape or magazine */
63 RequestSense_T *Erase(DEVICE_TYPE fd); /* send SHORT erase to drive */
65 void SCSI_Set_Timeout(int secs); /* set the SCSI timeout */
66 void SCSI_Default_Timeout(void); /* go back to default timeout */
68 /* we may not have this function :-(. */
69 #ifdef HAVE_GET_ID_LUN
70 scsi_id_t *SCSI_GetIDLun(DEVICE_TYPE fd);