Imported Upstream version 2.4.4p3
[debian/amanda] / docs / VTAPE-API
1
2 The upper level amanda code (including some of the other tape_xxx 
3 routines) calls the following routines which implement a virtual
4 tape table:
5     int tape_access(filename, mode) 
6         Acts like access(2) on possibly virtual devices
7     int tape_open(filename, mode)
8         Acts like open(2) on possibly virtual devices
9     int tape_stat(filename, buf) 
10         Acts like stat(2) on possibly virtual devices
11     int tapefd_close(tapefd)
12         Acts like close(2) on possibly virtual devices
13     int tapefd_fsf(tapefd, count)
14         Forward skips the (possibly virtual) device.
15     int tapefd_read(tapefd, buffer, count)
16         Reads a block from the (possibly virtual) device.
17     int tapefd_rewind(tapefd)
18         Reads a block from a (possibly virtual) device.
19     void tapefd_resetofs(tapefd)
20         Uses lseek() tricks to reset the write/read offset counter on
21         a virtual tape device.
22     int tapefd_unload(tapefd)
23         Unloads the media from a (possibly virtual) device.
24     int tapefd_status(tapefd) 
25         prints status of the (possibly virtual) device to standard output.
26     int tapefd_weof(tapefd, count)
27         writes a filemark/moves to the next file on a device for writing.
28     int tapefd_write(tapefd, buffer, count)
29         writes a block of data to a (possibly virtual) device.
30
31 For a tape type xxx, the following routines must be provided, and 
32 entered into the table "vtable" in tape-src/tapeio.c:
33     int xxx_tape_access(filename, mode) 
34     int xxx_tape_open(filename, mode)
35     int xxx_tape_stat(filename, buf) 
36     int xxx_tapefd_close(xxx_tapefd)
37     int xxx_tapefd_fsf(xxx_tapefd, count)
38     int xxx_tapefd_read(xxx_tapefd, buffer, count)
39     int xxx_tapefd_rewind(xxx_tapefd)
40     void xxx_tapefd_resetofs(xxx_tapefd)
41     int xxx_tapefd_unload(xxx_tapefd)
42     int xxx_tapefd_status(xxx_tapefd) 
43     int xxx_tapefd_weof(xxx_tapefd, count)
44     int xxx_tapefd_write(xxx_tapefd, buffer, count)
45
46 Along with a prefix string which will identify the type.  The initial
47 vtape layer has two types "plain" and "rait" (Redundant Array of
48 Inexpensive Tapes) but we hope to add a "rmt" (remote tape client),
49 and possibly "dvd" types soon.