2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-1998 University of Maryland at College Park
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of U.M. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. U.M. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
16 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Author: James da Silva, Systems Design and Analysis Group
24 * Computer Science Department
25 * University of Maryland at College Park
28 * $Id: tapeio.h,v 1.9.2.2.4.3.2.3 2003/03/07 20:55:37 martinea Exp $
30 * interface for tapeio.c
38 * Tape drive status structure. This abstracts the things we are
39 * interested in from the free-for-all of what the various drivers
44 char online_valid; /* is the online flag valid? */
45 char bot_valid; /* is the BOT flag valid? */
46 char eot_valid; /* is the EOT flag valid? */
47 char protected_valid; /* is the protected flag valid? */
48 char flags_valid; /* is the flags field valid? */
49 char fileno_valid; /* is the fileno field valid? */
50 char blkno_valid; /* is the blkno field valid? */
51 char device_status_valid; /* is the device status field valid? */
52 char error_status_valid; /* is the device status field valid? */
54 char online; /* true if device is online/ready */
55 char bot; /* true if tape is at the beginning */
56 char eot; /* true if tape is at end of medium */
57 char protected; /* true if tape is write protected */
58 long flags; /* device flags, whatever that is */
59 long fileno; /* tape file number */
60 long blkno; /* block within file */
61 int device_status_size; /* size of orig device status field */
62 unsigned long device_status; /* "device status", whatever that is */
63 int error_status_size; /* size of orig error status field */
64 unsigned long error_status; /* "error status", whatever that is */
67 #define FAKE_LABEL "[fake-label]"
71 int tapefd_rewind P((int tapefd));
72 int tapefd_unload P((int tapefd));
73 int tapefd_fsf P((int tapefd, int count));
74 int tapefd_weof P((int tapefd, int count));
76 int tapefd_status P((int tapefd, struct am_mt_status *));
78 void tapefd_resetofs P((int tapefd));
80 ssize_t tapefd_read P((int tapefd, void *buffer, size_t count));
81 ssize_t tapefd_write P((int tapefd, const void *buffer, size_t count));
83 char *tapefd_rdlabel P((int tapefd, char **datestamp, char **label));
84 char *tapefd_wrlabel P((int tapefd,
88 char *tapefd_wrendmark P((int tapefd, char *datestamp, unsigned int s));
90 int tapefd_eof P((int tapefd)); /* just used in tapeio-test */
91 int tapefd_close P((int tapefd));
92 int tapefd_can_fork P((int tapefd));
94 char *tape_unload P((char *dev));
95 char *tape_rewind P((char *dev));
96 char *tape_fsf P((char *dev, int count));
97 char *tape_rdlabel P((char *dev, char **datestamp, char **label));
98 char *tape_wrlabel P((char *dev,
102 char *tape_wrendmark P((char *dev,
105 char *tape_writable P((char *dev));
107 int tape_access P((char *dev, int mode));
108 int tape_stat P((char *filename, struct stat *buf));
110 char *tapefd_getinfo_label P((int fd));
111 void tapefd_setinfo_label P((int fd, char *v));
112 char *tapefd_getinfo_host P((int fd));
113 void tapefd_setinfo_host P((int fd, char *v));
114 char *tapefd_getinfo_disk P((int fd));
115 void tapefd_setinfo_disk P((int fd, char *v));
116 int tapefd_getinfo_level P((int fd));
117 void tapefd_setinfo_level P((int fd, int v));
118 char *tapefd_getinfo_datestamp P((int fd));
119 void tapefd_setinfo_datestamp P((int fd, char *v));
120 long tapefd_getinfo_length P((int fd));
121 void tapefd_setinfo_length P((int fd, long v));
122 char *tapefd_getinfo_tapetype P((int fd));
123 void tapefd_setinfo_tapetype P((int fd, char *v));
124 int tapefd_getinfo_fake_label P((int fd));
125 void tapefd_setinfo_fake_label P((int fd, int v));
126 int tapefd_getinfo_ioctl_fork P((int fd));
127 void tapefd_setinfo_ioctl_fork P((int fd, int v));
128 void tapefd_set_master_fd P((int tapefd, int master_fd));
130 #ifdef HAVE_LINUX_ZFTAPE_H
131 int is_zftape P((const char *filename));
134 int tapeio_init_devname P((char * dev,
138 char *tapeio_next_devname P((char * dev_left,
142 #endif /* ! TAPEIO_H */