Imported Upstream version 2.5.1
[debian/amanda] / server-src / taperscan.h
1 /*
2  * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
3  * 
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * for more details.
13  * 
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17  * 
18  * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
19  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
20  */
21
22 /*
23  * $Id: taperscan.h,v 1.3 2006/05/25 01:47:20 johnfranks Exp $
24  *
25  * This contains the interface to the tape-scan algorithm implementation.
26  * The interface is rather simple: Calling programs (taper, amcheck,
27  * amtape) call the function below with a desired tape label, and get back
28  * all the relevant label information, along with any other error messages.
29  */
30 #ifndef TAPERSCAN_H
31 #define TAPERSCAN_H
32
33
34 /* taper_scan(): Scans the changer to find a tape to use. Reads the tape
35  *               label, or invents a new one if label_new_tapes is in use.
36  *               Note that the returned label information should not be
37  *               re-read, because there may not actually exist a label
38  *               on-tape (for WORM or newly-labeled media).
39  *
40  * Inputs: wantlabel
41  * Outputs: Returns: -1 if an error occured or no tape was found.
42  *                    1 if the most desirable tape was found.
43  *                    2 if some other labeled tape was found.
44  *                    3 if a brand new tape was found, which we should
45  *                         label ASAP.
46  *          gotlabel: What label was actually retrieved or invented.
47  *         timestamp: What the timestamp string on-tape was. May be "X".
48  *     error_message: Debugging output.
49  *           tapedev: What device to use from now on.
50  *
51  * All returned strings are newly-allocated. */
52
53 int taper_scan (char* wantlabel,
54                   char** gotlabel, char** timestamp,
55                   char **tapedev,
56                   void taperscan_output_callback(void *data, char *msg),
57                   void *data);
58 void FILE_taperscan_output_callback(void *data, char *msg);
59 void CHAR_taperscan_output_callback(void *data, char *msg);
60
61 #endif  /* !TAPERSCAN_H */