2dc32ca866be6074ff55debb863dad4be12b1d49
[debian/amanda] / restore-src / restore.h
1 /*
2  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3  * Copyright (c) 1991-1998 University of Maryland at College Park
4  * All Rights Reserved.
5  *
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.
15  *
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.
22  *
23  * Authors: the Amanda Development Team.  Its members are listed in a
24  * file named AUTHORS, in the root directory of this distribution.
25  */
26 /*
27  * $Id: restore.h,v 1.5 2006/03/14 13:12:01 martinea Exp $
28  *
29  * 
30  */
31
32 #ifndef RESTORE_H
33 #define RESTORE_H
34
35 #include "fileheader.h"
36 #include "tapelist.h"
37 #include "amfeatures.h"
38
39 #define CREAT_MODE  0640
40
41 typedef struct match_list_s {
42     char *hostname;
43     char *diskname;
44     char *datestamp;
45     char *level;
46     struct match_list_s *next;
47 } match_list_t;
48
49 typedef struct rst_flags_s {
50     unsigned int inline_assemble:1;
51     unsigned int delay_assemble:1;
52     unsigned int compress:1;
53     unsigned int leave_comp:1;
54     unsigned int raw:1;
55     unsigned int headers:1;
56     unsigned int isafile:1;
57     unsigned int wait_tape_prompt:1; /* for interactive console use */
58     unsigned int amidxtaped:1; /* for client-daemon use */
59     unsigned int check_labels:1;
60     unsigned int mask_splits:1;
61     unsigned int fsf;
62     long blocksize;
63     int pipe_to_fd;
64     char *restore_dir;
65     char *comp_type;
66     char *alt_tapedev;
67     char *inventory_log;
68 } rst_flags_t;
69
70 char *make_filename P((dumpfile_t *file));
71 int disk_match P((dumpfile_t *file, char *datestamp,
72                     char *hostname, char *diskname, char *level));
73 void read_file_header P((dumpfile_t *file, int tapefd, int isafile,
74                          rst_flags_t *flags));
75 ssize_t restore P((dumpfile_t *file, char *filename, int tapefd, int isafile,
76                         rst_flags_t *flags));
77 void flush_open_outputs P((int reassemble, dumpfile_t *only_file));
78 void search_tapes P((FILE *prompt_out, int use_changer, tapelist_t *tapelist,
79                         match_list_t *restorethese, rst_flags_t *flags, 
80                         am_feature_t *their_features));
81 int have_all_parts P((dumpfile_t *file, int upto));
82 rst_flags_t *new_rst_flags P((void));
83 int check_rst_flags P((rst_flags_t *flags));
84 void free_rst_flags P((rst_flags_t *flags));
85 void free_match_list P((match_list_t *match_list));
86 int lock_logfile P(());
87
88 #endif /* RESTORE_H */
89